diff options
Diffstat (limited to 'perl-install/Makefile')
-rw-r--r-- | perl-install/Makefile | 194 |
1 files changed, 77 insertions, 117 deletions
diff --git a/perl-install/Makefile b/perl-install/Makefile index 299a34b85..68fe70782 100644 --- a/perl-install/Makefile +++ b/perl-install/Makefile @@ -1,154 +1,114 @@ -include Makefile.config +SO_FILES = c/blib/arch/auto/c/c.so +PMS = *.pm resize_fat/*.pm commands diskdrake +DEST = /tmp/t +DESTREP4PMS = $(DEST)/usr/bin/perl-install +PERL = ./perl +BINS = /bin/ash /sbin/mke2fs $(PERL) -.PHONY: all $(DIRS) install clean stage2 full_stage2 verify_c +.PHONY: all tags install clean verify_c -all: TAGS $(DIRS) +all: $(SO_FILES) -TAGS: $(PMS) - etags -o - $^ | ./perl2etags > $@ +tags: + etags -o - $(PMS) | perl2etags > TAGS clean: - for i in $(DIRS); do $(MAKE) -C $$i clean; done - rm -rf auto - find . -name "*~" -o -name ".#*" -o -name "TAGS" -o -name "*.old" | xargs rm -f + test ! -e c/Makefile || $(MAKE) -C c clean + find . -name "*~" -name "TAGS" -name "*.old" | xargs rm -f -tar-drakxtools: clean - $(MAKE) -C ../tools clean - cd .. ; rm -rf drakxtools ; cp -af perl-install drakxtools ; cp -af tools/ddcprobe tools/serial_probe drakxtools - cd ../drakxtools ; rm -rf install* pkgs.pm ftp.pm t.pm */CVS ; mv Makefile.drakxtools Makefile ; mv -f standalone/* . - cd .. ; tar cfy drakxtools.tar.bz2 --exclude CVS $(patsubst %,drakxtools/%,Makefile Makefile.config share/MonitorsDB share/Cards+ share/CardsNames Newt c ddcprobe serial_probe share/po pci_probing sbus_probing resize_fat share/diskdrake.rc $(STANDALONEPMS) icons *.pm) - cd .. ; rm -rf drakxtools +tar: clean + cd .. ; tar cfy perl-install.tar.bz2 --exclude perl-install/perl perl-install -$(DIRS): - install -d auto - $(MAKE) -C $@ +c/c.xs: c/c.xs.pm + chmod u+w $@ + perl $< > $@ + chmod a-w $@ -test_pms: verify_c - ./perl2fcalls -excludec -excluderesize_fat::c_rewritten install2 - for i in install2 install_steps_*.pm; do perl -cw -I. $$i; done +$(SO_FILES): c/c.xs + test -e c/Makefile || (cd c; perl Makefile.PL) + $(MAKE) -C c -test_all: test_pms - for i in $(PMS); do perl -cw -I. $$i; done +test_pms: verify_c + perl2fcalls -excludec install2.pm + (for i in $(PMS); do perl -cw -I. -Ic -Ic/blib/arch $$i || exit 1 ; done) verify_c: ./verify_c $(PMS) -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_pms: $(SO_FILES) + for i in `perl -ne 's/sub (\w+?)_? {.*/$$1/ and print' commands.pm`; do ln -sf commands $(DEST)/usr/bin/$$i; done install -d $(DESTREP4PMS) for i in $(PMS); do \ dest=$(DESTREP4PMS)/`dirname $$i`; \ install -d $$dest; \ - perl -ne 'print' $$i > $(DESTREP4PMS)/$$i; \ - perl -pe 's/#[-+].*//; $$_ = "\n" if (/^=head/ .. /^=cut/) || /use (diagnostics|vars|strict)/' $$i > $(DESTREP4PMS)/$$i; \ + perl -ne 'print #unless /^use (diagnostics|vars|strict)/' $$i > $(DESTREP4PMS)/$$i; \ done -# perl -pe 's/#-.*//; $$_ = "\n" if (/^=head/ .. /^=cut/) || /use (diagnostics)/' $$i > $(DESTREP4PMS)/$$i; \ - - cp share/*.rc $(DESTREP4PMS) - install -d $(DESTREP4PMS)/po - cp -f share/po/*.po* $(DESTREP4PMS)/po ||: - chmod a+x $(DESTREP4PMS)/install2 + @# cp -f $$i $$dest; \ + cp diskdrake.rc $(DESTREP4PMS) + ln -sf perl-install/install2.pm $(DEST)/usr/bin/install2 + ln -sf perl-install/commands $(DEST)/usr/bin/commands + chmod a+x $(DESTREP4PMS)/install2.pm chmod a+x $(DESTREP4PMS)/commands - chmod a+x $(DESTREP4PMS)/standalone/* - chmod a+x $(DESTREP4PMS)/g_auto_install -get_needed_files: $(DIRS) -# export PERL_INSTALL_TEST=1 ; strace -f -e trace=file -o '| grep -v "(No such file or directory)" | sed -e "s/[^\"]*\"//" -e "s/\".*//" | grep "^/" | grep -v -e "^/tmp" -e "^/home" -e "^/proc" -e "^/var" -e "^/dev" -e "^/etc" -e "^/usr/lib/rpm" > /tmp/list ' $(PERL) -d install2 < /dev/null - perl -pe "s/ARCH/$(ARCH)/g" share/list > /tmp/list + cp -af */blib/arch/auto $(DESTREP4PMS) + find $(DESTREP4PMS) -name "*.so" | xargs strip -# perl -pi -e 's/00503/6.0/g' /tmp/list -# see also /usr/lib/perl5/5.00503/ARCH-linux/Data/Dumper.pm +full_tar: + cp -af /usr/lib/perl5/site_perl/5.005/i386-linux/Gtk* $(DESTREP4PMS) + cp -af /usr/lib/perl5/site_perl/5.005/i386-linux/auto/Gtk $(DESTREP4PMS)/auto + find $(DESTREP4PMS) -name "*.so" | xargs strip + cd $(DESTREP4PMS)/.. ; tar cfz /tmp/perl-install.tgz perl-install - cat `../tools/specific_arch share/list` >> /tmp/list - find auto -follow -name "*.so" >> /tmp/list +get_needed_files: $(SO_FILES) + export PERL_INSTALL_TEST=1 ; strace -f -e trace=file -o '| grep -v "(No such file or directory)" | sed -e "s/[^\"]*\"//" -e "s/\".*//" | grep "^/" | grep -v -e "^/tmp" -e "^/home" -e "^/proc" -e "^/var" -e "^/dev" -e "^/etc" -e "^/usr/lib/rpm" > /tmp/list ' $(PERL) -d install2.pm < /dev/null - for i in $(LOCALFILES) `cat /tmp/list` ; do \ - ldd $$i 2>/dev/null | grep "=>" | sed -e 's/.*=> //' -e 's/ .*//' | uniq | sort >> /tmp/list; \ - done - - install -d $(DEST)/etc - install -d $(DEST)/lib install -d $(DEST)/bin install -d $(DEST)/usr/bin - install -d $(DEST)/usr/lib - install -d $(DEST)/usr/share - install -d $(DEST)/usr/share/gtk - install -d $(DEST)/usr/share/xmodmap - install -d $(DEST)/usr/X11R6/lib/X11 - install -d $(ROOTDEST)/Mandrake/base - install -s $(LOCALFILES) $(DEST)/usr/bin -# cp -f $(LOCALFILES2) $(DEST)/usr/bin -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 $(DEST)/usr/lib/X11 - ln -s /usr/X11R6/lib/X11/xkb/xkbcomp $(DEST)/usr/bin/xkbcomp -endif - - for i in `cat /tmp/list`; do \ - if (echo $$i | grep -q "lib/[^/]*\.so"); then \ - install -s $$i $(DEST)/lib; \ - 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; \ + for i in $(BINS) `grep "\.so" /tmp/list`; do \ + install -s $$i $(DEST)/usr/bin; \ + ldd $$i | sed -e 's/.*=> //' -e 's/ .*//' >> /tmp/list; \ done - mv -f $(DEST)/lib/libimlib-png.so $(DEST)/usr/lib - - 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 - - for i in fonts keyboards locales gconv; do tar xfy `../tools/specific_arch share/$$i.tar.bz2` -C $(DEST); done - - cd share ; cp -a modparm.lst $(DEST)/usr/share - cd share ; cp -a keymaps $(DEST)/usr/share - cd share ; cp -a consolefonts $(DEST)/usr/share - cd share ; cp template.in/*.in $(DEST)/usr/share - cd share ; cp MonitorsDB Cards+ CardsNames $(DEST)/usr/X11R6/lib/X11 - cd share ; cp *.xpm $(DEST)/usr/share - cd share ; cp -a themes $(DEST)/usr/share/gtk - cd share ; cp compssUsers compssList $(ROOTDEST)/Mandrake/base - - if [ -f ../modules/modules.cz* ]; then \ - cp -f ../modules/modules.cz* $(DEST)/lib/; \ - if [ -f ../modules64/modules.cz* ]; then \ - cp -f ../modules64/modules.cz* $(DEST)/lib/modules64.cz2; \ - fi \ - else \ - cp -f ../modules/modules.cpio.bz2 $(DEST)/lib/; \ - install -d $(DEST)/lib/modules; \ - cp -f ../modules/pristine/* $(DEST)/lib/modules ||: ; \ - fi + for i in `sort /tmp/list | uniq`; do \ + install -d $(DEST)/`dirname $$i` && \ + if (echo $$i | grep "\.pm"); then \ + perl -pe '$$_ eq "__END__" and exit(0);' $$i > $(DEST)/$$i; \ + else \ + cp -f $$i $(DEST)/$$i; \ + fi && \ + strip $(DEST)/$$i 2>/dev/null || true; \ + done + mv $(DEST)/usr/lib/*.so* $(DEST)/lib -# echo -e '#!/bin/sh\n\nexec "/usr/bin/sh"' > $(DEST)/usr/bin/runinstall2 -# chmod a+x $(DEST)/usr/bin/runinstall2 + ln -sf ../usr/bin/sh $(DEST)/bin/sh + ln -sf ../usr/bin/tr $(DEST)/bin/tr + ln -sf sh $(DEST)/bin/bash + ln -sf ash $(DEST)/usr/bin/sh -ifeq (i386,$(ARCH)) - tar xyC $(DEST) -f ../install/install1_pcmcia.$(ARCH).tar.bz2 ./etc/pcmcia -endif + echo -e "#!/usr/bin/perl\n\nsymlink '/tmp/rhimage/usr/lib/perl5', '/usr/lib/perl5';\nexec '/bin/sh'" > $(DEST)/usr/bin/runinstall2 + chmod a+x $(DEST)/usr/bin/runinstall2 - find $(DEST) -name CVS | xargs rm -rf +as_root: + /bin/dd if=/dev/zero of=/tmp/initrd bs=1k count=4000 + echo y | /sbin/mke2fs /tmp/initrd + losetup /dev/loop0 /tmp/initrd + mount /dev/loop0 /mnt/initrd + chmod a+w /mnt/initrd full_stage2: - if [ `id -u` = 0 ]; then rm -rf $(DEST); else $(SUDO) rm -rf $(DEST); fi - mkdir -p $(DEST) + rm -rf $(DEST)/[^M]* + @#mkdir -p $(DEST)/Mandrake/base + @#ln -s .. $(DEST)/Mandrake/instimage $(MAKE) get_needed_files $(MAKE) stage2 stage2: $(MAKE) install_pms - $(ROOTDEST)/misc/make_mdkinst_stage2 $(DEST) $(ROOTDEST)/Mandrake/base/mdkinst_stage2 + + @#rm -rf /mnt/initrd/* + @#cp -a $(DEST)/* /mnt/initrd + @#sync + @#dd if=/dev/loop0 | gzip -9 > /tmp/t/Mandrake/base/stage2.img + + +# function f() { grep "$*" /usr/include/*.h /usr/include/*/*.h; } |