[Asterisk-Users] CVS build patch

Ragnar Kjørstad asterisk at ragnark.vestdata.no
Sun Apr 13 08:15:06 MST 2003


Hi

I just tried to compile a new RPM from CVS, and had to change a few
things.

A couple of things have changed in new versions of rpm:
- "rpmbuild" is used to build rpms instead of "rpm"
- rpm complains when there are files in the install-dir that are
  not included in the package.

The attached patch changes:
- uses rpmrc and rpmmacros from CVS-source instead of copying to
  install-dir.
- Creates specfile in /tmp instead of /tmp/asterisk/
- version-tag from "CVS-xxxx CVS" to "CVS-xxxx"
- includes astman and the demo mp3-file in the package.

Works for me (tm).


-- 
Ragnar Kjørstad
Zet.no


===================================================================
RCS file: /usr/cvsroot/asterisk/Makefile,v
retrieving revision 1.1.1.6
diff -u -r1.1.1.6 Makefile
--- Makefile	18 Mar 2003 06:00:13 -0000	1.1.1.6
+++ Makefile	13 Apr 2003 15:07:20 -0000
@@ -309,12 +309,11 @@
 	make INSTALL_PREFIX=/tmp/asterisk samples ; \
 	mkdir -p /tmp/asterisk/etc/rc.d/init.d ; \
 	cp -f redhat/asterisk /tmp/asterisk/etc/rc.d/init.d/ ; \
-	cp -f redhat/rpmrc /tmp/asterisk/ ; \
-	cp -f redhat/rpmmacros /tmp/asterisk/ ; \
-	sed "s/Version:/Version: $(RPMVERSION)/g" redhat/asterisk.spec > /tmp/asterisk/asterisk.spec ; \
-	rpm --rcfile /usr/lib/rpm/rpmrc:/tmp/asterisk/rpmrc -bb /tmp/asterisk/asterisk.spec ; \
+	sed "s/Version: CVS/Version: $(RPMVERSION)/g" redhat/asterisk.spec > /tmp/asterisk.spec ; \
+	rpmbuild --rcfile /usr/lib/rpm/rpmrc:redhat/rpmrc -bb /tmp/asterisk.spec ; \
 	mv /tmp/asterisk/redhat/RPMS/i386/asterisk* ./ ; \
-	rm -rf /tmp/asterisk
+	rm -rf /tmp/asterisk ; \
+	rm -f /tmp/asterisk.spec
 
 progdocs:
 	doxygen asterisk-ng-doxygen
Index: redhat/asterisk.spec
===================================================================
RCS file: /usr/cvsroot/asterisk/redhat/asterisk.spec,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 asterisk.spec
--- redhat/asterisk.spec	12 Feb 2003 13:59:15 -0000	1.1.1.1
+++ redhat/asterisk.spec	13 Apr 2003 15:07:21 -0000
@@ -54,6 +54,7 @@
 # Asterisk
 #
 %attr(0755,root,root)      /usr/sbin/asterisk
+%attr(0755,root,root)      /usr/sbin/astman
 %attr(0755,root,root)      /usr/sbin/safe_asterisk
 %attr(0755,root,root)      /usr/sbin/astgenkey
 
@@ -71,6 +72,7 @@
 %attr(0644,root,root)      /var/lib/asterisk/keys/*
 %attr(0755,root,root) %dir /var/lib/asterisk/agi-bin
 %attr(0755,root,root) %dir /var/lib/asterisk/agi-bin/*
+%attr(0755,root,root)      /var/lib/asterisk/mohmp3/sample-hold.mp3
 
 #
 # Example voicemail files
Index: redhat/rpmrc
===================================================================
RCS file: /usr/cvsroot/asterisk/redhat/rpmrc,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 rpmrc
--- redhat/rpmrc	12 Feb 2003 13:59:15 -0000	1.1.1.1
+++ redhat/rpmrc	13 Apr 2003 15:07:21 -0000
@@ -1,3 +1,3 @@
 #############################################################
-macrofiles:     /usr/lib/rpm/macros:/usr/lib/rpm/%{_target}/macros:/etc/rpm/macros:/etc/rpm/%{_target}/macros:~/.rpmmacros:/tmp/asterisk/rpmmacros
+macrofiles:     /usr/lib/rpm/macros:/usr/lib/rpm/%{_target}/macros:/etc/rpm/macros:/etc/rpm/%{_target}/macros:~/.rpmmacros:redhat/rpmmacros
 #############################################################




More information about the asterisk-users mailing list