[Pkg-mol-devel] mol: take part at pkg-mol

Jörg Sommer joerg at alea.gnuu.de
Mon Sep 24 17:02:41 UTC 2007


Hi Gaudenz,

I would like to take part in pkg-mol. My alioth account is jo-guest.

At first a new rules files. It's much more cleaner and fixes the problem
with building twice in a row. Now the directory looks the same before and
after building.

The changes:
• Added -g to the CFLAGS because policy section 10.1 suggests to build
  with debugging symbols and strip them later

• Added support for DEB_BUILD_OPTIONS=noopt as suggested by policy
  section 10.1.

• Rearranged the targets in the file: clean, build, binary.

• clean:
  · Removed the dh_testroot. clean doesn't need root previleges.

  · Put the unpatch target into the command sequence, because it's more
    intuitive.

  · Removed debian/tmp from the dh_clean call. It's not needed.

  · Call “dpatch apply Makefile” before running make distclean, because
    it fails due to the missing bootx directory.

• Merged the configure and the build targets.

• Use make defconf instead of yes '' | make conf to create the
  configuration.

• binary-arch:
  · Added a -a to every dh_* call, because we build the arch specific
    packages.

  · No need to fix manually the permission of mol.symbols

  · Replaced the m4 call by an sed call. This saves a build dependency.
    The file should get renamed, because sed can edit inplace.

• Added the get-orig-source target that fetches the upstream tar.bz2 and
  creates the .orig.tar.gz. This is what policy suggests in section 4.9.

Other things:
• I suggest to rename debian/debian.mol-source/changelog.m4.m4 to
  changelog.m4 as said above.

• Remove m4 from the build dependencies.

• Remove debian/mol-source.dirs. It's not needed.

• Fix the lintian warning about the menu file. -> mol.menu.patch

• Strip down debian/mol.dirs. Is /var/state/mol really used?
  -> mol.dirs.patch

• Fix #412756 -> Makefile.mol-source.patch

• Why is a ~ in the version? ~ is a special character. I would use +

• Did upstream refuse to include the manpages?

• Does upstream know the problem with the buggy distclean, i.e. it
  doesn't remove all files and it runs configure.

• Why does upstream ignore the values (e.g. --datadir) passed to
  configure?

• Why does upstream build the configuration interface if defconf is used?

• lintian complains about hyphen-used-as-minus-sign in manpages.

• The copyright files is not up to date.

Schöne Grüße, Jörg.
-- 
Ein Narr, er sieht die Weisheit nicht,
selbst wenn sie närrisch zu ihm spricht.
-------------- next part --------------
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# This file is public domain software, originally written by Joey Hess. 

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# include dpatch rules
include /usr/share/dpatch/dpatch.make

# the values from configure aren't used by the Makefile so we have to pass
# them to every make call
DEBIANFLAGS=prefix=/usr datadir=/usr/share/mol libdir=/usr/lib/mol \
  docdir=/usr/share/doc/mol

CFLAGS += -g -D_FILE_OFFSET_BITS=64

ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -O0
else
	CFLAGS += -O2
endif

# Debian package version
VERSION=$(shell dpkg-parsechangelog | grep Version: | cut -d " " -f 2)
UPSTREAM_VERSION=$(shell echo $(VERSION) | sed s/~dfsg.*//)

clean:
	dh_testdir
	dh_clean
	rm -f build-stamp

# remove the manpages
	rm -f debian/*.[17] mol.tar.bz2

	dpatch apply Makefile
	$(MAKE) distclean

# upstream bug: distclean does not remove these files
	rm -rf obj-ppc config/configure
	rm -f .config* util/img/mol-img

	$(MAKE) -f debian/rules unpatch

build: build-stamp
build-stamp: patch
	dh_testdir

# build the Debian specific manpages
	(cd debian; \
		for man in mol.7 moldeb.1 molrcget.1 strip_nwrom.1; \
		do docbook-to-man $${man%?}sgml >$$man; \
	done)

	./configure --disable-png CFLAGS="$(CFLAGS)"
	make defconfig

# build the package
	$(MAKE) BUILD_MODS=n NETDRIVER=n $(DEBIANFLAGS)

# setup the build structure for the kernel modules
	$(MAKE) -C src/kmod/Linux/ KERNEL_SOURCE=/lib/modules/`uname -r`/source \
	    setup-common
	$(MAKE) -C src/netdriver/ setup-tree-common

	touch $@

# Build architecture-independent files here.
binary-indep:
# We have nothing to do by default.

# Build architecture-dependent files here.
binary-arch: build
	dh_testdir
	dh_testroot

	dh_installdirs -a

# install the overrides file for lintian
	install -o root -g root -m 644 debian/lintian.overrides \
	    debian/mol/usr/share/lintian/overrides/mol

# install the Mac-on-Linux emulator into mol.
	$(MAKE) DESTDIR=`pwd`/debian/mol $(DEBIANFLAGS) install

	rm debian/mol/usr/share/doc/mol/COPYING

	convert -depth 8 -size 100x122 -frame 14x3 -mattecolor '#ffffce' \
	    -scale 25% rgb:`pwd`/mollib/graphics/bootlogo.raw \
	    debian/mol/usr/share/pixmaps/mol.xpm

# put together the mol-source package by copying the relevant code
	mkdir -p modules/mol
# the directory is full of symlinks
	cp -prL obj-ppc/build/src/kmod obj-ppc/build/src/netdriver \
	    modules/mol

# add the Debian directory and the top-level Makefile
	cp -pr debian/debian.mol-source modules/mol/debian
	#sed -i 's/MOL_VERSION/$(VERSION)/; q' modules/mol/debian/changelog.m4
	sed '1s/MOL_VERSION/$(VERSION)/' < modules/mol/debian/changelog.m4.m4 \
	   > modules/mol/debian/changelog.m4
	rm modules/mol/debian/changelog.m4.m4
	cp -p debian/Makefile.mol-source modules/mol/Makefile

# set correct permissions
	chmod u+x modules/mol/debian/rules
	chown -R root:src modules
	chmod -R u+w,go-w,a+rX modules

	tar jcf mol.tar.bz2 modules
	rm -r modules
	dh_install -pmol-source mol.tar.bz2 usr/src

	dh_installdebconf -a
	dh_installdocs -a
	dh_installexamples -a
	dh_installman -a
	dh_installmenu -a
	dh_installmodules -a
	dh_installchangelogs -a CHANGELOG
	dh_link -a
	dh_strip -a
	dh_compress -a
	dh_fixperms -a
	dh_installdeb -a
	dh_shlibdeps -a -Xlib/modules
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a

binary: binary-indep binary-arch

TAR_NAME=mol-$(UPSTREAM_VERSION).tar.bz2
MOL_DIR_NAME=mol-$(shell echo $(VERSION) | sed s/-.*//)

get-orig-source:
	wget http://dfn.dl.sourceforge.net/sourceforge/mac-on-linux/$(TAR_NAME)
	tar -xf $(TAR_NAME)
	rm $(TAR_NAME)

	mv $(TAR_NAME:.tar.bz2=) $(MOL_DIR_NAME)
	cd $(MOL_DIR_NAME) && rm -r bootx mollib/drivers \
	    mollib/images/moldisk.dmg mollib/images/moldiskX.dmg

	tar -czf $(MOL_DIR_NAME).orig.tar.gz $(MOL_DIR_NAME)
	rm -r $(MOL_DIR_NAME)

.PHONY: build clean binary-indep binary-arch binary get-orig-source
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mol.menu.patch
Type: text/x-diff
Size: 565 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/pkg-mol-devel/attachments/20070924/01dd6244/attachment.patch 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mol.dirs.patch
Type: text/x-diff
Size: 343 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/pkg-mol-devel/attachments/20070924/01dd6244/attachment-0001.patch 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Makefile.mol-source.patch
Type: text/x-diff
Size: 723 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/pkg-mol-devel/attachments/20070924/01dd6244/attachment-0002.patch 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/pkg-mol-devel/attachments/20070924/01dd6244/attachment.pgp 


More information about the Pkg-mol-devel mailing list