]> git.pld-linux.org Git - packages/distcc.git/blobdiff - distcc.spec
- rel 0.2; use distcc user instead of nobody
[packages/distcc.git] / distcc.spec
index f0b0b3eda557d766314894190a80a57883ffb574..9264c8ecd04a0012e53e360d74a72620b24f19cd 100644 (file)
@@ -6,11 +6,12 @@ Summary:      Program to distribute compilation of C or C++
 Summary(pl):   Program do rozdzielania kompilacji programów w C lub C++
 Name:          distcc
 Group:         Development/Languages
-Version:       2.15
+Version:       2.18
 Release:       0.2
 License:       GPL
 Source0:       http://distcc.samba.org/ftp/distcc/%{name}-%{version}.tar.bz2
-# Source0-md5: 96c636bbce34f6851c059390d3a18250
+# Source0-md5: a55b547d4ff62d8500e290b82671db50
+# Source0-size:        339939
 Source1:       %{name}.inetd
 Source2:       %{name}.init
 Source3:       %{name}.sh
@@ -18,7 +19,6 @@ Source4:      %{name}.csh
 Source5:       %{name}.config
 Source6:       %{name}.logrotate
 Patch0:                %{name}-user.patch
-Patch1:                %{name}-waal.patch
 URL:           http://distcc.samba.org/
 BuildRequires: autoconf >= 2.53
 BuildRequires: automake
@@ -65,6 +65,8 @@ Summary(pl):  Pliki konfiguracyjne do u
 Group:         Daemons
 PreReq:                %{name}-common = %{version}-%{release}
 PreReq:                rc-inetd
+Requires(pre): /usr/sbin/useradd
+Requires(postun):      /usr/sbin/userdel
 Obsoletes:     distcc < 2.1-2
 
 %description inetd
@@ -79,7 +81,8 @@ Summary(pl):  Pliki konfiguracyjne do startowania distcc w trybie standalone
 Group:         Daemons
 PreReq:                %{name}-common = %{version}-%{release}
 PreReq:                rc-scripts
-Requires(post,preun):  /sbin/chkconfig
+Requires(pre): /usr/sbin/useradd
+Requires(postun):      /usr/sbin/userdel
 Obsoletes:     distcc < 2.1-2
 
 %description standalone
@@ -114,7 +117,6 @@ Monitor gtk dla distcc.
 %prep
 %setup -q
 %patch0 -p1
-#%patch1 -p1
 
 sed -i -e 's#PKGDATADIR#"%{_pixmapsdir}"#g' src/mon-gnome.c
 
@@ -154,6 +156,16 @@ touch $RPM_BUILD_ROOT%{_var}/log/distcc
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%pre inetd
+if [ -n "`/bin/id -u distcc 2>/dev/null`" ]; then
+       if [ "`/bin/id -u distcc`" != "137" ]; then
+               echo "Error: user distcc doesn't have uid=137. Correct this before installing distccd server." 1>&2
+               exit 1
+       fi
+else
+       /usr/sbin/useradd -u 137 -d /tmp -s /bin/false -c "distcc user" -g distcc distcc 1>&2
+fi
+
 %post inetd
 if [ -f /var/lock/subsys/rc-inetd ]; then
        /etc/rc.d/init.d/rc-inetd reload 1>&2
@@ -165,6 +177,19 @@ fi
 if [ -f /var/lock/subsys/rc-inetd ]; then
        /etc/rc.d/init.d/rc-inetd reload
 fi
+if [ "$1" = "0" ]; then
+        %userremove distcc
+fi
+
+%pre standalone
+if [ -n "`/bin/id -u distcc 2>/dev/null`" ]; then
+       if [ "`/bin/id -u distcc`" != "137" ]; then
+               echo "Error: user distcc doesn't have uid=137. Correct this before installing distccd server." 1>&2
+               exit 1
+       fi
+else
+       /usr/sbin/useradd -u 137 -d /tmp -s /bin/false -c "distccd user" -g distcc distcc 1>&2
+fi
 
 %post standalone
 /sbin/chkconfig --add distcc
@@ -174,6 +199,11 @@ else
        echo "Run \"/etc/rc.d/init.d/distcc start\" to start distcc daemon."
 fi
 
+%postun standalone
+if [ "$1" = "0" ]; then
+       %userremove distcc
+fi
+
 %preun standalone
 if [ "$1" = "0" ]; then
        if [ -f /var/lock/subsys/distccd ]; then
@@ -192,10 +222,10 @@ fi
 %files common
 %defattr(644,root,root,755)
 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/sysconfig/distccd
-%attr(640,root,root) /etc/logrotate.d/distccd
+%attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/logrotate.d/distccd
 %attr(755,root,root) %{_bindir}/%{name}d
 %{_mandir}/man?/%{name}d.*
-%attr(640,nobody,root) %ghost %{_var}/log/distcc
+%attr(640,distcc,root) %ghost %{_var}/log/distcc
 
 %files inetd
 %defattr(644,root,root,755)
This page took 0.093017 seconds and 4 git commands to generate.