diff options
Diffstat (limited to 'perl-install/Makefile')
| -rw-r--r-- | perl-install/Makefile | 278 |
1 files changed, 50 insertions, 228 deletions
diff --git a/perl-install/Makefile b/perl-install/Makefile index 86dd6feb4..0fe946485 100644 --- a/perl-install/Makefile +++ b/perl-install/Makefile @@ -1,271 +1,93 @@ -PACKAGE=drakxtools -PKGVERSION:=$(shell rpm -q --qf '%{VERSION}\n' --specfile $(PACKAGE).spec|head -n 1) -RELEASE:=$(shell rpm -q --qf '%{RELEASE}\n' --specfile $(PACKAGE).spec|head -n 1) -TAG := $(shell echo "V$(PKGVERSION)_$(RELEASE)" | tr -- '-.' '__') - include ../Makefile.config include Makefile.config +PACKAGE = drakxtools +PKGVERSION = $(VERSION) + POFILES = $(shell ls share/po/*.po) MOFILES = $(POFILES:%.po=%.mo) -DISTFILES = *.pm $(PMS_DIRS) Makefile Makefile.config ddcprobe drakxtools.spec serial_probe share/po share/diskdrake.rc $(STANDALONEPMS) standalone/icons pixmaps pixmaps/langs standalone/interactive_http rpcinfo-flushed.c standalone/service_harddrake.sh OTHERS = $(OTHERDIRS) $(OTHERFILES) -OTHERDIRS = tools/ddcprobe tools/serial_probe +OTHERDIRS = tools/serial_probe OTHERFILES = tools/rpcinfo-flushed.c -STAGE1 = ../mdk-stage1 +.PHONY: all $(DIRS) install clean -.PHONY: all $(DIRS) install clean stage2 full_stage2 - -all: list_modules.pm TAGS $(DIRS) +all: TAGS $(DIRS) xs: $(DIRS) -list_modules.pm: - ln -sf ../kernel/list_modules.pm - TAGS: $(ALLPMS) - @etags -o - $^ /usr/lib/perl5/*/*/MDK/Common/*.pm | ./perl2etags > $@ + -etags $^ /usr/lib/perl5/*/*/MDK/Common/*.pm clean: - for i in $(DIRS) share/po; do $(MAKE) -C $$i clean; done;: - rm -rf auto ../drakxtools.tar.bz2 *.bak + for i in $(DIRS) share/po install/help/po install/share/po; do $(MAKE) -C $$i clean; done;: + rm -rf auto drakxtools*.tar* *.bak find . -name "*~" -o -name ".#*" -o -name "TAGS" -o -name "*.old" | xargs rm -f + rm -rf $(PACKAGE)-$(PKGVERSION)* -check: - perl -I. -Mlang -e 'lang::check' - perl -I. -Mkeyboard -e 'keyboard::check' +check_pms_encoding: + @for i in $(ALLPMS); do charset=ascii; grep -q 'use utf8' $$i && charset=utf8; iconv -f $$charset -t $$charset $$i >/dev/null || { echo "bad $$charset character in $$i"; exit 1; }; done -localcopy: clean - rm -rf standalone/pixmaps - $(MAKE) -C ../tools clean || : - cd .. ; rm -rf $(PACKAGE)-$(PKGVERSION) ; cp -af perl-install $(PACKAGE)-$(PKGVERSION) ; cp -af $(OTHERS) $(PACKAGE)-$(PKGVERSION) - cd .. ; rm -f $(PACKAGE)-$(PKGVERSION)/probe.c; cp -a mdk-stage1/{log.h,pcmcia_/{probe.c,*.h}} $(PACKAGE)-$(PKGVERSION)/c/ - cd - @make nuke_perl +check_full: check_pms_encoding + perl -I. -Mlang -e 'lang::check' +check2: + perl -I. -Mkeyboard -e 'keyboard::check' $(DIRS): install -d auto $(MAKE) -C $@ test_pms: - perl_checker install2.pm install_steps_gtk.pm install_steps_stdio.pm partition_table/*.pm standalone/{harddrake2,diskdrake,draksec} + perl_checker install/install2.pm install/steps_gtk.pm install/steps_stdio.pm partition_table/*.pm standalone/{harddrake2,diskdrake,draksec} test_pms_all: - perl_checker $(shell echo $(ALLPMS) | perl -pe 's!(printer|share/advertising)\S+!!g') + perl_checker -v --generate-package-dependencies-graph .deps $(ALLPMS) %.mo: %.po msgfmt -o $@ $< -install_pms: $(DIRS) - for i in `perl -ne 's/sub (\w+?)_?(\(\))? {.*/$$1/ and print' commands.pm` sync; do ln -sf commands $(DEST)/usr/bin/$$i; done - - install -d $(DESTREP4PMS) - find $(DESTREP4PMS) -name "*.pm.gz" | xargs rm -f - for i in $(PMS); do \ - dest=$(DESTREP4PMS)/`dirname $$i`; \ - install -d $$dest; \ - perl -ne 'print' $$i > $(DESTREP4PMS)/$$i; \ - perl -pe 's/#[-+].*//; $$_ = "\n" if (/^=(head|begin)/ .. /^=cut/) || /use (diagnostics|strict|vars|warnings)/' $$i > $(DESTREP4PMS)/$$i; \ - done - - rm -f $(DESTREP4PMS)/{bootlook,tinyfirewall}.pm - - cp share/*.rc $(DESTREP4PMS) - chmod a+x $(DESTREP4PMS)/install2 - chmod a+x $(DESTREP4PMS)/commands +install_pms stage2 full_stage2: + make -C install $@ mo_files : $(MOFILES) -get_needed_files: $(DIRS) mo_files - eval `perl -V:version`; \ - cat share/list `../tools/specific_arch share/list` | \ - perl -pe "s/ARCH/$(ARCH)/g ; s/PERL_VERSION/$$version/g ; s|/LIB/|/$(LIB)/|g " | \ - perl -lpe '@l = glob; m|\*.*/| && @l != 1 and die "no/multiple match for $$_\n"; $$_ = join("\n", @l)' > /tmp/list - rpm -ql perl-Gtk2 perl-Glib | grep '^/usr/lib/perl5' | grep -v '\.pod$$' >> /tmp/list - - @missing=`perl -lne 'print if !-e $$_' /tmp/list`; [ -z "$$missing" ] || { echo "missing or multiple files vvvvvvvvvvvvvvvvvvvvvvvvvv" ; echo "$$missing" ; echo "missing or multiple files ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^" ; exit 1; } - - find auto -follow -name "*.so" >> /tmp/list - - for i in $(LOCALFILES) `cat /tmp/list` ; do \ - ldd $$i 2>/dev/null | grep "=>" | perl -pe 's/.*=> //; s/ .*//; s,^/lib/.*?/,/lib/,' | sort | uniq >> /tmp/list; \ - done - - perl -Mlang -I. -e 'print "$$_\n" foreach lang::console_font_files()' >> /tmp/list - - install -d $(DEST)/etc - install -d $(DEST)/etc/sysconfig/network-scripts - install -d $(DEST)/lib - install -d $(DEST)/$(LIB) - install -d $(DEST)/bin - install -d $(DEST)/usr/bin - install -d $(DEST)/usr/lib - install -d $(DEST)/usr/$(LIB) - install -d $(DEST)/usr/share - install -d $(DEST)/usr/share/langs - install -d $(DEST)/usr/share/gtk - install -d $(DEST)/usr/share/xmodmap - install -d $(DEST)/usr/X11R6/lib/X11/locale - install -d $(MEDIA_INFO_DEST) - install -s $(LOCALFILES) $(DEST)/usr/bin -# cp -f $(LOCALFILES2) $(DEST)/usr/bin - ln -s ../X11R6/lib/X11 $(DEST)/usr/lib/X11 -ifeq (sparc,$(ARCH)) - cp -a /usr/X11R6/lib/X11/xkb $(DEST)/usr/X11R6/lib/X11 - rm -f $(DEST)/usr/X11R6/lib/X11/xkb/compiled - ln -s /tmp $(DEST)/usr/X11R6/lib/X11/xkb/compiled - ln -s /usr/X11R6/lib/X11/xkb/xkbcomp $(DEST)/usr/bin/xkbcomp -endif - cp -a /usr/X11R6/lib/X11/locale/{C,en_US.UTF-8,iso8859-1} $(DEST)/usr/X11R6/lib/X11/locale - -ifeq (i386,$(ARCH)) - install -s /sbin/cardmgr $(DEST)/usr/bin -endif - - for i in `cat /tmp/list`; do \ - if (echo $$i | grep -q "lib/[^/]*\.so"); then \ - install -s $$i $(DEST)/lib; \ - elif (echo $$i | grep -q "lib64/[^/]*\.so"); then \ - install -s $$i $(DEST)/lib64; \ - else \ - d=$$i; \ - (echo $$d | grep -q "^[^/]") && d="$(REP4PMS)/$$d"; \ - d=`echo $(DEST)/$$d | sed 's/\/usr\/local\//\/usr\//'`; \ - install -d `dirname $$d` && \ - if (echo $$i | grep -q "\.pm"); then \ - perl -pe '$$_ =~ /^__END__/ and exit(0);' $$i > $$d; \ - elif (echo $$i | grep -q "\.so"); then \ - install -s $$i $$d; \ - else \ - cp -f $$i $$d; \ - fi; \ - fi; \ - done - perl -pi -e 's/\s*use\s+(warnings|diagnostics|strict|vars|warnings).*//g' $(DEST)/usr/*/*/*/utf8_heavy.pl - - mv -f $(DEST)/bin/* $(DEST)/sbin/* $(DEST)/usr/bin - cd $(DEST)/usr/bin ; mv insmod insmod_ - rmdir $(DEST)/bin $(DEST)/sbin - - perl -ane 'symlink "$$F[1]", "$(DEST)/usr/bin/$$F[0]"' share/aliases - -ifeq (i386,$(ARCH)) - cp ../tools/i386/busybox $(DEST)/usr/bin -endif -ifeq (x86_64,$(ARCH)) - cp ../tools/x86_64/busybox $(DEST)/usr/bin/ -endif -ifeq (ia64,$(ARCH)) - ln -sf bash $(DEST)/usr/bin/sh -else - ln -sf ash $(DEST)/usr/bin/sh -endif - - for i in fonts keyboards locales-skeleton keymaps; do tar xfj `../tools/specific_arch share/$$i.tar.bz2` -C $(DEST); done - - grep ChangeLog CVS/Entries > $(DEST)/usr/share/VERSION - - gzip -9f $(DEST)/usr/share/ldetect-lst/* - - cd share ; cp -a consolefonts devices symlinks $(DEST)/usr/share - -cd share ; cp -f *.png $(DEST)/usr/share - -cd pixmaps ; cp -af *.png *.xpm $(DEST)/usr/share ; rm -f $(DEST)/usr/share/wiz_* - cp `perl -I. -Mlang -e 'lang::png_lang_files()'` $(DEST)/usr/share/langs - cd share ; cp compssUsers.pl* rpmsrate $(MEDIA_INFO_DEST) +# rules to build tarball +dist: tar - perl -I. -Mlang -e 'symlink "UTF-8", "$(DEST)/usr/share/locale/$$_" foreach lang::list_langs()' - - clean-rpmsrate $(MEDIA_INFO_DEST)/rpmsrate $(MAIN_RPMS_DIR) - - for i in ../kernel/modules.description ../kernel/all.modules/modules.cz*; do cp -f $$i $(DEST)/lib/; done - - $(MAKE) -C share/po install SUDO= NAME=libDrakX LOCALEDIR=$(DEST)/usr/share/locale_special - -# ga and sl are disabled because too few messages are translated - rm -rf $(DEST)/usr/share/locale_special/{ga,sl} - -ifeq (i386,$(ARCH)) - cp -a /etc/pcmcia $(DEST)/etc - ../tools/patch_pcmcia_config.pl $(DEST)/etc/pcmcia/config ../kernel/all.modules/`cat ../kernel/all.kernels/.main`/modules.dep -endif - - cp -f $(STAGE1)/init-stage2 $(DEST)/usr/bin/init - - find $(DEST) -name CVS | xargs rm -rf - -full_stage2: - $(MAKE) stage2 - $(MISC_DEST)/make_mdkinst_stage2 $(DEST) $(STAGE2_DEST)/mdkinst_stage2 - -stage2: - if [ `id -u` = 0 ]; then rm -rf $(DEST); else $(SUDO) rm -rf $(DEST); fi - mkdir -p $(DEST) - $(MAKE) get_needed_files - $(MAKE) install_pms - find $(DEST)/usr -name "*.pm" | xargs gzip -9f - cd $(DEST)/usr/lib/perl5 ; gunzip 5.*/{PerlIO,Exporter}.pm.gz 5.*/*-linux-thread-multi/{XSLoader,lib}.pm.gz vendor_perl/*/*-linux-thread-multi/PerlIO/gzip.pm.gz - -# rules to build a test rpm - -localrpm: localdist buildrpm - -localsrpm: spec_test localdist buildsrpm - -srpm: spec_test cvstag localsrpm - -localdist: cleandist localcopy tar - -cleandist: - rm -rf ../$(PACKAGE)-$(PKGVERSION) ../$(PACKAGE)-$(PKGVERSION).tar.bz2 - -spec_test: - @if [[ -z "$(PKGVERSION)" ]]; then echo "unable to get spec version"; exit 3;fi - @if [[ -z "$(RELEASE)" ]]; then echo "unable to get spec release"; exit 2;fi - -tar: - cd ../$(PACKAGE)-$(PKGVERSION) && perl -pi -e 's/^C_RPM.*/C_RPM=0/; s/^C_DRAKX.*/C_DRAKX=0/' c/Makefile - cd ../$(PACKAGE)-$(PKGVERSION) && perl -pi -e 's/^all: help/all:/' share/po/Makefile - cd ../$(PACKAGE)-$(PKGVERSION) && rm -rf install* pkgs.pm help.pm ftp.pm http.pm crypto.pm t.pm debug.log `find -name CVS` - cd ../$(PACKAGE)-$(PKGVERSION) && mv -f Makefile.drakxtools Makefile - cd ../$(PACKAGE)-$(PKGVERSION) && rm -f list_modules.pm && cp -f ../kernel/list_modules.pm . - cd ..; tar cfj $(PACKAGE)-$(PKGVERSION).tar.bz2 $(patsubst %,$(PACKAGE)-$(PKGVERSION)/%,$(DISTFILES)) - cd ..; rm -rf $(PACKAGE)-$(PKGVERSION) - -buildrpm: - rpm -ta ../$(PACKAGE)-$(PKGVERSION).tar.bz2 +tar: clean + rm -rf $(PACKAGE)*.tar* $(PACKAGE)-$(PKGVERSION) + mkdir -p $(PACKAGE)-$(PKGVERSION)/tools + (cd ..; git archive HEAD "perl-install/" $(OTHERS) kernel/list_modules.pm Makefile.config) | tar xC $(PACKAGE)-$(PKGVERSION) + rm -rf $(PACKAGE)-$(PKGVERSION)/perl-install/{install,unused,list_modules.pm} + cp -f ../kernel/list_modules.pm $(PACKAGE)-$(PKGVERSION)/perl-install + cd $(PACKAGE)-$(PKGVERSION)/perl-install ; mv -f Makefile.drakxtools Makefile + @make nuke_perl + tar cfa $(PACKAGE)-$(PKGVERSION).tar.xz $(PACKAGE)-$(PKGVERSION) + rm -rf $(PACKAGE)-$(PKGVERSION) + $(info $(PACKAGE)-$(PKGVERSION).tar.xz is ready) -buildsrpm: - rpm -ts --nodeps ../$(PACKAGE)-$(PKGVERSION).tar.bz2 +tag: + git tag -a $(VERSION) -m "$(VERSION)" # rules to build a distributable rpm -rpm: cvstag dist buildrpm - -slowsrpm: spec_test cvstag dist buildsrpm - -dist: cleandist export tar - -export: - cd ..; cvs export -d $(PACKAGE)-$(PKGVERSION) -r $(TAG) $(PACKAGE) - cd ../$(PACKAGE)-$(PKGVERSION) && rm -rf $(OTHERDIRS) && set -x && for f in $(OTHERDIRS); do cvs -d `cat ../CVS/Root` export -r $(TAG) -d `basename $$f` gi/$$f; done - cd ..; set -x && for f in $(OTHERFILES); do cvs -d `cat ../CVS/Root` export -r $(TAG) -d $(PACKAGE)-$(PKGVERSION) gi/$$f; done - @make nuke_perl +nuke_perl: + find $(PACKAGE)-$(PKGVERSION)/perl-install -name '*.pm' | xargs ../tools/simplify-drakx-modules + find $(PACKAGE)-$(PKGVERSION)/perl-install/standalone -type f | xargs ../tools/simplify-drakx-modules -cvstag: - cvs tag $(CVSTAGOPT) $(TAG) - cd ..; cvs tag $(CVSTAGOPT) $(TAG) $(OTHERS) +# [pixel] for my grep looking for any .pm files +pixel_standalone_links: + rm -rf .standalone_apps.swa + mkdir .standalone_apps.swa + for i in $(STANDALONEPMS_); do ln -sf ../standalone/$$i .standalone_apps.swa/$$i.pm; done -nuke_perl: - find ../$(PACKAGE)-$(PKGVERSION) -name '*.pm' | xargs perl -pi -e 's/\s*use\s+(diagnostics|strict|vars|warnings).*//g' - find ../$(PACKAGE)-$(PKGVERSION)/standalone -type f | xargs perl -pi -e 's/\s*use\s+(diagnostics|strict|vars|warnings).*//g' +check_perl_checker: + rm -f share/po/libDrakX.pot install/share/po/DrakX.pot + @make -C share/po libDrakX.pot + @make -C install/share/po DrakX.pot -dont_run_directly_stage2: - rm -f $(DEST)/usr/bin/runinstall2 - echo -e '#!/bin/sh\n\nexec /usr/bin/busybox sh' > $(DEST)/usr/bin/runinstall2 - chmod a+x $(DEST)/usr/bin/runinstall2 +list_firmwares.pm: + ../tools/find-drivers-needing-nonfree-firmware -trace_stage2: - eval `perl -V:vendorlib`; install -m 644 -D $$vendorlib/Devel/Trace.pm $(DEST)$$vendorlib/Devel/Trace.pm - perl -pi -e 's|(#!/usr/bin/perl).*|$$1 -d:Trace|' $(DEST)/usr/bin/runinstall2 +.PHONY: list_firmwares.pm |
