Salut,

J'ai poste un patch il y a quelque temps pour make rpm, et dans le wiki, je
vois qu'il y a 'many problems encountered'. Lesquels ?

Personnellement je trouve mon patch meilleur parce que
- il ne suppose pas que l'architecture est i586, ni que le repertoire de base
  de rpm est ~/rpm (chez moi c'est, selon, ~/RPM ou ~/rpmbuild)
- il n'y a pas deux cas pour root et un utilisateur non root, ni de test de 
  ~/.rpmmacros, ~/.rpmrc, qui sont (il me semble) facultatifs
- il y a plus de 'rules' veritables, ce qui permet de mieux isoler les erreurs

Sinon, je le ressoumet contre le Makefile de CVS (avec le patch que je viens
d'envoyer deja applique).

Pat
Index: Makefile
===================================================================
RCS file: /cvs/eagleusb/eagleusb/Makefile,v
retrieving revision 1.23
diff -u -3 -p -u -r1.23 Makefile
--- Makefile    4 Oct 2004 20:45:09 -0000       1.23
+++ Makefile    10 Oct 2004 11:36:39 -0000
@@ -100,34 +100,29 @@ dist: maintainer-clean
        rm -f ../$(ARCHNAME).tar.bz2 && \
        ./makedist $(ARCHNAME) `pwd`
 
+RPMTOPDIR=$(shell rpm --eval %_topdir)
+RPMARCH=$(shell rpm --eval %_arch)
+
 rpm: dist
-       if [ `id -ur` == 0 ] ; then \
-               rm -f /usr/src/RPM/SOURCES/$(ARCHNAME).tar.bz2 ; \
-               cp ../eagle-usb.dist/$(ARCHNAME).tar.bz2 /usr/src/RPM/SOURCES ; 
\
-               rpmbuild --define='_prefix /usr' -ba eagle-usb.spec ; \
-               mv -f /usr/src/RPM/RPMS/i586/eagle-usb-*.rpm ../eagle-usb.dist 
; \
-               mv -f /usr/src/RPM/SRPMS/eagle-usb-*.rpm ../eagle-usb.dist ; \
-       else \
-               if [ "`whereis -b rpmbuild`" = "rpmb:" ] ; then \
-                       echo "Error: rpm-build was not found on your system!" ; 
\
-                       exit 1 ; \
-               fi ; \
-               if [ ! -d ~/rpm ] ; then \
-                       echo "Error: ~/rpm missing, you should consider reading 
Mandrakesoft's RpmHowTo..." ; \
-                       exit 1 ; \
-               fi ; \
-               if [ ! -f ~/.rpmmacros ] || [ ! -f ~/.rpmrc ] ; then \
-                       echo "Error: ~/.rpmmacros or ~/.rpmrc is missing, you 
should consider reading Mandrakesoft's RpmHowTo..." ; \
-                       exit 1 ; \
-               fi ; \
-               rm -f ~/rpm/SOURCES/$(ARCHNAME).tar.bz2 ; \
-               cp ../eagle-usb.dist/$(ARCHNAME).tar.bz2 ~/rpm/SOURCES ; \
-               rpmbuild --define='_prefix /usr' -ba eagle-usb.spec ; \
-               mv -f ~/rpm/RPMS/i586/eagle-usb-*.rpm ../eagle-usb.dist ; \
-               mv -f ~/rpm/SRPMS/eagle-usb-*.rpm ../eagle-usb.dist ; \
+       if [ "`whereis -b rpmbuild`" = "rpmb:" ] ; then \
+               echo "Error: rpm-build was not found on your system!" ; \
+               exit 1 ; \
+       fi
+       if [ "z$(RPMTOPDIR)" = "z" ]; then \
+               echo "Error: no rpm top dir"; \
+               exit 1 ; \
        fi
-               #rpmbuild -ta ../eagle-usb.dist/$(ARCHNAME).tar.bz2 ; \
-
+       if [ ! -d "$(RPMTOPDIR)" ]; then \
+               echo "Error: rpm top dir not a directory"; \
+               exit 1 ; \
+       fi
+       rm -f "$(RPMTOPDIR)/SOURCES/$(ARCHNAME).tar.bz2"
+       cp ../eagle-usb.dist/$(ARCHNAME).tar.bz2 $(RPMTOPDIR)/SOURCES
+       rpmbuild -ba eagle-usb.spec
+       mv -f $(RPMTOPDIR)/SRPMS/eagle-usb-*.rpm ../eagle-usb.dist
+       mv -f $(RPMTOPDIR)/RPMS/$(RPMARCH)/eagle-usb-*.rpm ../eagle-usb.dist
+       #rpmbuild -ta ../eagle-usb.dist/$(ARCHNAME).tar.bz2
+ 
 DEBVERSION = $(shell sed -ne '1s/.*(\(.*\)-\(.*\)).*/\1/p' debian/changelog)
 deb:
        fakeroot debian/rules clean

Reply via email to