1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
|
#!/usr/bin/make -f
# -*- mode: makefile; coding: utf-8 -*-
# Common include files
include /usr/share/cdbs/1/rules/patchsys-quilt.mk
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/makefile.mk
# Path to squashfs-tools
DEB_STOOLS = $(CURDIR)/squashfs-tools
# Manpages stuff
DOC_DIR = debian/doc
PO_DIR = $(DOC_DIR)/po
MAN_TMP_DIR = $(DOC_DIR)/manpages
MANPAGES = $(addprefix $(DOC_DIR)/,en/mksquashfs.1 fr/mksquashfs.fr.1 en/unsquashfs.1)
XSLT_CMD = xsltproc -''-nonet -''-param man.charmap.use.subset "0"
DB2MAN = /usr/share/sgml/docbook/stylesheet/xsl/nwalsh/manpages/docbook.xsl
# Flags to GCC
CFLAGS += -I$(DEB_STOOLS) -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
# The build directory is squashfs-tools
DEB_MAKE_INVOKE := cd $(DEB_STOOLS) && $(DEB_MAKE_INVOKE)
DEB_MAKE_BUILD_TARGET := all
DEB_MAKE_CHECK_TARGET :=
DEB_MAKE_CLEAN_TARGET :=
# Squashfs-tools manpages targets
install/squashfs-tools:: po $(MANPAGES)
po:
mkdir -p $(dir $(MANPAGES))
cd $(PO_DIR) && po4a -v po4a.cfg
%.1: %.dbk
cd $(<D) && $(XSLT_CMD) $(DB2MAN) $(<F)
mv $(@D)/*.1 $(DOC_DIR)/$(@F)
## Squashfs-modules packages
STAMP_CONFIG = $(CURDIR)/debian/stamp-configure
# Version of the Linux Kernel
DIR_MOD = linux-2.6
SNAME = squashfs
PSOURCE = $(SNAME)-source
MNAME = $(SNAME)-modules
pre-build::
# Create the 'linux-2.6' directory using last patch of squashfs, it is
# needed for out-of-tree compilation
if ! test -f $(STAMP_CONFIG); then \
mkdir -p $(DIR_MOD); \
patch -d $(DIR_MOD) -Np1 -f -i ../kernel-patches/linux-2.6.24/squashfs3.3-patch; \
mv $(DIR_MOD)/fs/squashfs/* $(DIR_MOD); \
mv $(DIR_MOD)/include/linux/* $(DIR_MOD); \
rm -rf $(DIR_MOD)/fs $(DIR_MOD)/include; \
touch $(STAMP_CONFIG); \
fi
# For creating correctly the 'squashfs-source' package which will be
# used for building module package with custom kernel
install/squashfs-source::
# Create the needed directories
mkdir -p debian/modules/$(SNAME)/debian \
debian/$(PSOURCE)/usr/src
# Copy the source and header files
cp $(DIR_MOD)/*.h $(DIR_MOD)/*.c $(DIR_MOD)/Makefile \
debian/modules/$(SNAME)
# Copy the debian specific files
cp debian/changelog debian/compat debian/copyright debian/*.modules.in \
debian/modules/$(SNAME)/debian
# This rules file is specific to m-a
install -m755 debian/rules.modules \
debian/modules/$(SNAME)/debian/rules
# Finally create the tarball which contains the modules directory
cd debian && tar jcf $(PSOURCE)/usr/src/$(SNAME).tar.bz2 modules
# Common targets
clean::
rm -rf $(DOC_DIR)/fr $(DOC_DIR)/*.8 $(DOC_DIR)/*.1 $(DOC_DIR)/en/*.8 $(DIR_MOD) debian/modules
rm -f $(DEB_STOOLS)/*.o $(DEB_STOOLS)/mksquashfs $(DEB_STOOLS)/unsquashfs $(STAMP_CONFIG)
|