SPECS: setup.spec - trigger written in C, now it must be OK !

sparky sparky at pld-linux.org
Sat Sep 17 14:50:49 CEST 2005


Author: sparky                       Date: Sat Sep 17 12:50:49 2005 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- trigger written in C, now it must be OK !

---- Files affected:
SPECS:
   setup.spec (1.111 -> 1.112) 

---- Diffs:

================================================================
Index: SPECS/setup.spec
diff -u SPECS/setup.spec:1.111 SPECS/setup.spec:1.112
--- SPECS/setup.spec:1.111	Sat Sep 17 00:25:33 2005
+++ SPECS/setup.spec	Sat Sep 17 14:50:44 2005
@@ -25,6 +25,7 @@
 # Source0-md5:	7f50f1650e961a77b18afa0a4a588fc1
 Source1:	http://www.sethwklein.net/projects/iana-etc/downloads/iana-etc-%{iana_etc_ver}.tar.bz2
 # Source1-md5:	9f769f7b2d0e519cf62dacb2b3b051d4
+Source2:	%{name}-update-fstab.c
 # This is source of non-iana changes in services file
 #Patch0:		%{name}-services.patch
 BuildRequires:	dietlibc-static
@@ -71,6 +72,7 @@
 
 %prep
 %setup -q -a1
+install %{SOURCE2} update-fstab.c
 
 %build
 %{__make} -C iana-etc-%{iana_etc_ver}
@@ -78,6 +80,9 @@
 %{__make} \
 	OPT_FLAGS="%{rpmcflags} %{?with_ssp:-fno-stack-protector}" \
 	CC="diet %{__cc}"
+%{__make} update-fstab \
+	OPT_FLAGS="%{rpmcflags}" \
+	CC="diet %{__cc}"
 
 %install
 rm -rf $RPM_BUILD_ROOT
@@ -86,6 +91,8 @@
 %{__make} install \
 	DESTDIR=$RPM_BUILD_ROOT
 
+install update-fstab $RPM_BUILD_ROOT%{_sbindir}
+
 install iana-etc-%{iana_etc_ver}/protocols $RPM_BUILD_ROOT/etc/protocols
 # don't overwrite files from setup tar-ball, fix it in original tar!
 #install iana-etc-%{iana_etc_ver}/services $RPM_BUILD_ROOT/etc/services
@@ -95,31 +102,13 @@
 
 %triggerpostun -p %{_sbindir}/joinpasswd -- %{name} < %{version}-%{release}
 
-%triggerin -p <lua> -- %{name} < 2.4.10-1
-
--- this script adds ",devmode=0664,devgid=78" in usbfs in old fstab
--- Warning: it''s not checking if it was already updated
-
-print("Warning: updating /etc/fstab")
-
-F = io.input("/etc/fstab")
-txt = io.read("*a")
-io.close(F)
-
-usbfs = string.find(txt, "usbfs")
-default = string.find(txt, "def", usbfs)
-put_in = string.find(txt, "%s", default)
-
-F = io.output("/etc/fstab")
-io.write(string.sub(txt, 0, put_in - 1))
-io.write(",devmode=0664,devgid=78")
-io.write(string.sub(txt, put_in))
-io.close(F)
+%triggerin -p %{_sbindir}/update-fstab -- %{name} < 2.4.10-1
 
 %files
 %defattr(644,root,root,755)
 %doc ChangeLog
 %attr(755,root,root) %{_sbindir}/joinpasswd
+%attr(755,root,root) %{_sbindir}/update-fstab
 %attr(755,root,root) /etc/profile.d/*.sh
 %attr(755,root,root) /etc/profile.d/*.csh
 %dir /etc/profile.d
@@ -146,6 +135,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.112  2005/09/17 12:50:44  sparky
+- trigger written in C, now it must be OK !
+
 Revision 1.111  2005/09/16 22:25:33  sparky
 - trigger script written in lua
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SPECS/setup.spec?r1=1.111&r2=1.112&f=u




More information about the pld-cvs-commit mailing list