Skip to contentSkip to conversation

xfsprogs: simplify and unify source package generation

PATCH In review Christoph Hellwig 3 participants 5 messages Oct 11, 2009 – Oct 25, 2009 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfsprogs: simplify and unify source package generation

Currently the build/ directory can create rpm, debian and source / binary tar packages. The RPM generation is not used as all distributions prefer their own spec files, and the binary tarball not used at all as it's a not very useful format. Reimplement the generation of the source tarballs to use the source-link method used for the debian packages and get rid of the whole old package generation machinery. Also fix a small bug in the link-based source directory creation which was not including the .pot file for gettext.

build/rpm/Makefile deleted +0 -62
Index: xfsprogs-dev/build/rpm/Makefile
===================================================================
@@ -1,62 +0,0 @@
-#
-# Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
-#
-
-TOPDIR = ../..
-TREEROOT = $(shell cd ${TOPDIR}; pwd)
-include $(TOPDIR)/include/builddefs
-
-SPECF = $(PKG_NAME).spec
-LDIRT = *.rpm $(SPECF) rpmmacros rpmfiles* rpm-*.rc
-
-LSRCFILES = macros.template $(SPECF).in rpm-2.rc.template
-
-default install install-dev install-lib:
-
-include $(BUILDRULES)
-
-# Generate a binary rpm file
-dist : default $(SPECF) rpm-$(RPM_VERSION).rc
-	$(RPMBUILD) -ba --rcfile ./rpm-$(RPM_VERSION).rc $(SPECF)
-
-# Because rpm prior to v.2.90 does not support macros and old style config
-# is not supported by rpm v.3, we have to resort to such ugly hacks
-ifneq ($(RPM_VERSION),2)
-rpm-$(RPM_VERSION).rc : rpmmacros
-	@$(SED) -e '/^macrofiles:/s|~/.rpmmacros|rpmmacros|' </usr/lib/rpm/rpmrc >$@
-
-rpmmacros : macros.template
-	@$(SED) -e 's|%topdir%|$(TREEROOT)|g' < $< > $@
-else
-rpm-2.rc: rpm-2.rc.template
-	@$(SED) -e 's|%topdir%|$(TOPDIR)|g' < $< > $@
-endif
-
-# Generate the rpm specfile format file list from the install-sh manifest
-rpmfiles rpmfiles-dev rpmfiles-lib:
-	$(SORT) -u $$DIST_MANIFEST | $(AWK) > $@ '\
-$$1 == "d" { printf ("%%%%dir %%%%attr(%s,%s,%s) %s\n", $$2, $$3, $$4, $$5); } \
-$$1 == "f" { if (match ($$6, "$(PKG_MAN_DIR)") || \
-                match ($$6, "$(PKG_DOC_DIR)")) \
-                printf ("%%%%doc "); \
-            if (match ($$6, "$(PKG_MAN_DIR)")) \
-                printf ("%%%%attr(%s,%s,%s) %s*\n", $$2, $$3, $$4, $$6); \
-            else \
-                printf ("%%%%attr(%s,%s,%s) %s\n", $$2, $$3, $$4, $$6); } \
-$$1 == "l" { if (match ($$3, "$(PKG_MAN_DIR)") || \
-                match ($$3, "$(PKG_DOC_DIR)")) \
-                printf ("%%%%doc "); \
-            if (match ($$3, "$(PKG_MAN_DIR)")) \
-                printf ("%%%%attr(0777,root,root) %s*\n", $$3); \
-            else \
-                printf ("%%%%attr(0777,root,root) %s\n", $$3); }'
-
-.PHONY: $(SPECF)
-${SPECF} : ${SPECF}.in
-	$(SED) -e's|@pkg_name@|$(PKG_NAME)|g' \
-	    -e's|@pkg_version@|$(PKG_VERSION)|g' \
-	    -e's|@pkg_release@|$(PKG_RELEASE)|g' \
-	    -e's|@pkg_distribution@|$(PKG_DISTRIBUTION)|g' \
-	    -e's|@build_root@|$(DIST_ROOT)|g' \
-	    -e'/^BuildRoot: *$$/d' \
-	    -e's|@make@|$(MAKE)|g' < $< > $@
build/rpm/macros.template deleted +0 -30
Index: xfsprogs-dev/build/rpm/macros.template
===================================================================
@@ -1,30 +0,0 @@
-#
-# rpmrc.template
-#
-# Template to fudge rpm directory structure inside IRIX-like build
-# environment
-
-# Force 386 build on all platforms
-%_target i386-pc-linux
-%_target_cpu i386
-%_target_os linux
-
-# topdir == $(WORKAREA)
-%_topdir %topdir%
-
-# Following directories are specific to the topdir
-# This is where build is done. In our case it's the same as $WORKAREA
-%_builddir %topdir%
-
-# This is where foo.1.99.tar.gz is living in the real world.
-# Be careful not to run full rpm build as it will override the sources 
-%_sourcedir %topdir%/build
-
-# This is where binary RPM and source RPM would end up
-%_rpmdir    %topdir%/build/rpm
-%_srcrpmdir %topdir%/build/rpm
-%_specdir   %topdir%/build/rpm
-
-# Leave RPM files in the same directory - we're not building for 
-# multiple architectures
-%_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm
build/rpm/rpm-2.rc.template deleted +0 -25
Index: xfsprogs-dev/build/rpm/rpm-2.rc.template
===================================================================
@@ -1,25 +0,0 @@
-#
-# rpmrc.template
-#
-# Template to fudge rpm directory structure inside IRIX-like build
-# environment
-
-# topdir == $(WORKAREA)
-topdir: %topdir%
-
-# Following directories are specific to the topdir
-# This is where build is done. In out case it's the same as $WORKAREA
-# Be careful not to run full rpm build as it will override the sources 
-builddir: %topdir%
-
-# This is where foo.1.99.tar.gz is living in the real world.
-sourcedir: %topdir%/build
-
-# This is where binary RPM and source RPM would end up
-rpmdir:    %topdir%/build/rpm
-srcrpmdir:  %topdir%/build/rpm
-specdir:   %topdir%/build/rpm
-
-# Leave RPM files in the same directory - we're not building for 
-# multiple architectures
-rpmfilename: %{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}.rpm
build/rpm/xfsprogs.spec.in deleted +0 -78

78 lines not on this page · raw message

build/Makefile deleted +0 -50

50 lines not on this page · raw message

build/tar/Makefile deleted +0 -22
Index: xfsprogs-dev/build/tar/Makefile
===================================================================
@@ -1,22 +0,0 @@
-#
-# Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
-#
-
-TOPDIR = ../..
-include $(TOPDIR)/include/builddefs
-
-BINTAR=$(PKG_NAME)-$(PKG_VERSION).bin.tar.gz
-LDIRT = *.gz
-
-default install install-dev install-lib:
-
-include $(BUILDRULES)
-
-dist : default
-	@HERE=`pwd`; cd $${DIST_ROOT:-/}; \
-	$(SORT) -u $$HERE/../bin-manifest | $(AWK) ' \
-		$$1 == "f" { printf (".%s\n", $$6); } \
-		$$1 == "d" { next; } \
-		$$1 == "l" { printf (".%s\n", $$3); }' \
-	| $(TAR) -T - -cf - | $(ZIP) --best > $$HERE/$(BINTAR)
-	@echo Wrote: `pwd`/$(BINTAR)
Makefile +41 -5

67 lines not on this page · raw message

release.sh +2 -2
Index: xfsprogs-dev/release.sh
===================================================================
@@ -18,8 +18,8 @@ git-commit -a -m "${version} release"
 echo "Tagging git repository"
 git-tag v${version}
 
-echo "Creating source tarball in build/tar/"
-./Makepkgs
+echo "Creating source tarball"
+make dist
 
 echo "Done."
 echo "Please remember to push out tags using \"git push --tags\""
Makepkgs deleted +0 -109

109 lines not on this page · raw message

.gitignore +0 -1
Index: xfsprogs-dev/.gitignore
===================================================================
@@ -3,7 +3,6 @@
 
 # build system
 .census
-Logs/
 include/platform_defs.h
 include/builddefs
 install-sh
debian/rules +1 -1
Index: xfsprogs-dev/debian/rules
===================================================================
@@ -67,7 +67,7 @@ binary-arch: checkroot built
 	$(pkgme)  $(MAKE) -C . install
 	$(pkgdev) $(MAKE) -C . install-dev
 	$(pkgdi)  $(MAKE) -C debian install-d-i
-	$(pkgme)  $(MAKE) -C build src-manifest
+	$(pkgme)  $(MAKE) dist
 	rmdir debian/xfslibs-dev/usr/share/doc/xfsprogs
 	dh_installdocs
 	dh_installchangelogs
README +0 -3
Index: xfsprogs-dev/README
===================================================================
@@ -10,6 +10,3 @@ and references to other XFS manual pages
 For more information and details on how to contribute to the
 XFS project see the web pages at:
 	http://oss.sgi.com/projects/xfs/
-
-For more information on the build process, please refer to
-the doc/PORTING document.
doc/INSTALL +1 -10
Index: xfsprogs-dev/doc/INSTALL
===================================================================
@@ -28,16 +28,7 @@ Linux Instructions
    (on an RPM based system) or the uuid-dev package (on a Debian system)
    as some of the commands make use of the UUID library provided by these.
 
-   If you just want to spin an RPM and/or tar file, use the Makepkgs
-   script in the top level directory. This will configure and build
-   the package and leave binary and src RPMs in the build/rpm
-   directory.  It will also leave a tar file in the build/tar
-   directory.
-
-	# ./Makepkgs verbose
-
-   If you want to build the package and install it manually, use the
-   following steps:
+   To build the package and install it manually, use the following steps:
 
 	# make
 	# su root
doc/Makefile +2 -2
Index: xfsprogs-dev/doc/Makefile
===================================================================
@@ -5,7 +5,7 @@
 TOPDIR = ..
 include $(TOPDIR)/include/builddefs
 
-LSRCFILES = INSTALL PORTING CHANGES COPYING CREDITS sparse.txt
+LSRCFILES = INSTALL CHANGES COPYING CREDITS sparse.txt
 LDIRT = *.gz
 
 default: CHANGES.gz
@@ -17,7 +17,7 @@ CHANGES.gz:
 
 install: default
 	$(INSTALL) -m 755 -d $(PKG_DOC_DIR)
-	$(INSTALL) -m 644 PORTING CHANGES.gz CREDITS $(PKG_DOC_DIR)
+	$(INSTALL) -m 644 CHANGES.gz CREDITS $(PKG_DOC_DIR)
 ifeq ($(PKG_DISTRIBUTION), debian)
 	$(INSTALL) -S CHANGES.gz $(PKG_DOC_DIR)/changelog.gz
 else
doc/PORTING deleted +0 -86

86 lines not on this page · raw message

include/buildmacros +0 -16
Index: xfsprogs-dev/include/buildmacros
===================================================================
@@ -134,19 +134,3 @@ MAN_MAKERULE = \
 			$(ZIP) --best -c < $$f > $$f.gz; \
 		fi; \
 	done
-
-DIST_MAKERULE = \
-	$(MAKEF) -C build dist
-
-SOURCE_MAKERULE = \
-	@test -z "$$DIR" && DIR="."; \
-	for f in $(SRCFILES) $(POTHEAD) ""; do \
-	    test -z "$$f" && break; \
-	    test -L "$$f" || $(ECHO) $$DIR/$$f; \
-	done; \
-	for d in `echo $(SUBDIRS)` ""; do \
-	    test -z "$$d" && break; \
-	    if test -d "$$d"; then \
-		$(MAKEF) DIR=$$DIR/$$d -C $$d $@ || exit $$?; \
-	    fi; \
-	done
include/buildrules +3 -6
Index: xfsprogs-dev/include/buildrules
===================================================================
@@ -23,12 +23,12 @@ endif
 
 source-link: 
 	@test -z "$$DIR" && DIR="."; \
-	for f in `echo $(SRCFILES) $(SUBDIRS)`; do \
+	for f in `echo $(SRCFILES) $(SUBDIRS) $(POTHEAD)`; do \
 	    if test -d $$f ; then \
-		mkdir $$SRCLINK_ROOT/$$DIR/$$f || exit $$?; \
+		mkdir $(TOPDIR)/$(PKG_NAME)-$(PKG_VERSION)/$$DIR/$$f || exit $$?; \
 		$(MAKEF) DIR=$$DIR/$$f -C $$f $@ || exit $$?; \
 	    else \
-		ln $$f $$SRCLINK_ROOT/$$DIR/$$f || exit $$?; \
+		ln $$f $(TOPDIR)/$(PKG_NAME)-$(PKG_VERSION)/$$DIR/$$f || exit $$?; \
 	    fi; \
 	done
 
@@ -73,9 +73,6 @@ update-po: $(POTHEAD) $(wildcard $(TOPDI
 	$(MSGFMT) -c --statistics -o $@ $<
 endif
 
-source :
-	$(SOURCE_MAKERULE)
-
 endif # _BUILDRULES_INCLUDED_
 
 $(_FORCE):

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#1 lore raw
Quoted 14 lines · ----- "Christoph Hellwig

Currently the build/ directory can create rpm, debian and source / binary
tar packages. The RPM generation is not used as all distributions prefer,
their own spec files, and the binary tarball not used at all as it's a not very useful format. Reimplement the generation of the source tarballs to use the source-link method used for the debian packages and
get rid of the whole old package generation machinery. Also fix a small
bug in the link-based source directory creation which was not including
the .pot file for gettext.

Quoted 1 line

From looking through the patch it seems OK to me. I haven't had a chance

to test it out yet, though - but from just eyeballing it, and if noone pipes up complaining about the auto-rpm-build removal (I don't expect they will, at this stage of xfsprogs life) it all looks good and correct.

cheers.

Signature · 6 lines
Nathan

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#2 lore raw
Quoted 16 lines · Nathan Scott
Quoted 5 lines · ----- "Christoph Hellwig

Currently the build/ directory can create rpm, debian and source / binary
tar packages. The RPM generation is not used as all distributions prefer,
their own spec files, and the binary tarball not used at all as it's

Quoted 8 lines

a not very useful format. Reimplement the generation of the source tarballs to use the source-link method used for the debian packages and
get rid of the whole old package generation machinery. Also fix a small
bug in the link-based source directory creation which was not including
the .pot file for gettext.

Quoted 7 lines

From looking through the patch it seems OK to me. I haven't had a chance to test it out yet, though - but from just eyeballing it, and if noone pipes up complaining about the auto-rpm-build removal (I don't expect they will, at this stage of xfsprogs life) it all looks good and correct.

cheers.

die rpmbuild die ;)

Long as building tarballs works I'm happy.

-Eric

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#3 lore raw
In reply to Nathan Scott
Quoted 4 lines · Nathan Scott
Quoted 1 line

From looking through the patch it seems OK to me. I haven't had a chance

to test it out yet, though - but from just eyeballing it, and if noone pipes up complaining about the auto-rpm-build removal (I don't expect they will, at this stage of xfsprogs life) it all looks good and correct.

Thanks. Does this count as a reviewed-by?

Btw, one other thing I'm pondering is removing the automatic call to ./configure from make if it's not configured yet. It causes lots of pain for the toplevel makefile and the makefile snipplets in include/. We'd have to replace the .deb building makefile snipplet with a build-debs.sh shell script, but that might be cleaner anyway.

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#4 lore raw
Quoted 11 lines · ----- "Christoph Hellwig
Quoted 1 line · Nathan Scott
Quoted 1 line

From looking through the patch it seems OK to me. I haven't had a

chance

Quoted 1 line

to test it out yet, though - but from just eyeballing it, and if

noone

Quoted 1 line

pipes up complaining about the auto-rpm-build removal (I don't

expect

Quoted 1 line

they will, at this stage of xfsprogs life) it all looks good and

correct.

Thanks. Does this count as a reviewed-by?

Yep, sorry - Reviewed-by: Nathan Scott <[email protected]>

Quoted 6 lines

Btw, one other thing I'm pondering is removing the automatic call to ./configure from make if it's not configured yet. It causes lots of pain for the toplevel makefile and the makefile snipplets in include/.
We'd have to replace the .deb building makefile snipplet with a build-debs.sh shell script, but that might be cleaner anyway.

Its not so bad IMO & we seem to be getting into the realm of gratuitous change, but - *shrug* - doesn't make much difference I guess, I'm sure people will figure it out pretty quickly.

cheers.

Signature · 6 lines
Nathan

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs