rules 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. #!/usr/bin/make -f
  2. # Sample debian/rules that uses debhelper.
  3. # GNU copyright 1997 to 1999 by Joey Hess.
  4. # Uncomment this to turn on verbose mode.
  5. #export DH_VERBOSE=1
  6. # This is the debhelper compatability version to use.
  7. export DH_COMPAT=1
  8. #include version
  9. major=$(shell grep '^MAJOR_VERSION' Rules.mak|sed 's/.*=//')
  10. minor=$(shell grep '^MINOR_VERSION' Rules.mak|sed 's/.*=//')
  11. version:=$(strip $(major)).$(strip $(minor))
  12. target=$(DEB_HOST_GNU_CPU)
  13. #target=powerpc
  14. build: build-stamp
  15. build-stamp:
  16. dh_testdir
  17. # Add here commands to compile the package.
  18. cp extra/Configs/Config.$(shell echo $(target)|sed 's/i386/x86/') Config
  19. echo '#Debian configuration overrides' >>Config
  20. ifneq ($(TARGET),native)
  21. echo 'TARGET_ARCH = $(target)' >>Config
  22. echo 'CROSS = $(target)-linux-' >>Config
  23. endif
  24. echo 'DOPIC = true' >>Config
  25. echo 'PREFIX = $$(DESTDIR)/usr' >>Config
  26. echo 'DEVEL_PREFIX = $$(PREFIX)/$$(TARGET_ARCH)-linux-uclibc' >>Config
  27. echo 'TARGET_PREFIX = $$(DESTDIR)/' >>Config
  28. $(MAKE)
  29. touch build-stamp
  30. clean:
  31. dh_testdir
  32. dh_testroot
  33. rm -f build-stamp
  34. # Add here commands to clean up after the build process.
  35. -$(MAKE) clean
  36. dh_clean
  37. install: build
  38. dh_testdir
  39. dh_testroot
  40. dh_clean -k
  41. dh_installdirs
  42. # Add here commands to install the package into debian/tmp.
  43. $(MAKE) install_dev DESTDIR=`pwd`/debian/tmp
  44. $(MAKE) install_target DESTDIR=`pwd`/debian/libuclibc0
  45. $(MAKE) install_gcc DESTDIR=`pwd`/debian/uclibc-gcc
  46. install -m 644 debian/uclibc-gcc.1 \
  47. debian/uclibc-gcc/usr/share/man/man1/$(target)-uclibc-gcc.1
  48. (cd debian/uclibc-gcc/usr/share/man/man1; \
  49. ln -sf $(target)-uclibc-gcc.1.gz $(target)-uclibc-cc.1.gz; \
  50. ln -sf $(target)-uclibc-gcc.1.gz $(target)-uclibc-ld.1.gz; \
  51. for x in addr2line ar as cpp gasp nm objcopy objdump ranlib \
  52. size strings strip;do \
  53. ln -sf $$x.1.gz $(target)-uclibc-$$x.1.gz;done)
  54. install -d debian/libuclibc0/usr/share/man/man1
  55. install -m 644 debian/uclibc-ldd.1 \
  56. debian/libuclibc0/usr/share/man/man1/$(target)-uclibc-ldd.1
  57. install -m 644 debian/uclibc-ldconfig.1 \
  58. debian/libuclibc0/usr/share/man/man1/$(target)-uclibc-ldconfig.1
  59. # some hacks here
  60. ifeq ($(TARGET),native)
  61. (cd debian/libuclibc0/usr/bin;mv ldd $(target)-uclibc-ldd)
  62. (cd debian/libuclibc0/sbin;mv ldconfig $(target)-uclibc-ldconfig)
  63. (cd debian/tmp/usr/$(target)-linux-uclibc/bin; \
  64. rm ldd; \
  65. ln -sf ../../bin/$(target)-uclibc-ldd ldd;)
  66. (cd debian/tmp/usr/$(target)-linux-uclibc/sbin; \
  67. rm ldconfig; \
  68. ln -sf /sbin/$(target)-uclibc-ldconfig ldconfig;)
  69. endif
  70. (cd debian/tmp/usr/$(target)-linux-uclibc/lib; \
  71. rm ld-uclibc-$(version).so; \
  72. for x in util c m dl crypt;do \
  73. rm libuClib$$x-$(version).so; \
  74. rm lib$$x.so; \
  75. ln -sf /lib/libuClib$$x-$(version).so lib$$x.so ; \
  76. rm libuClib$$x.so; \
  77. ln -sf /lib/libuClib$$x-$(version).so libuClib$$x.so ; \
  78. done)
  79. (cd debian/tmp/usr/lib; \
  80. for x in util c m dl crypt;do \
  81. ln -sf /lib/libuClib$$x-$(version).so libuClib$$x.so ; \
  82. done)
  83. (cd debian/libuclibc0/lib; \
  84. for x in util c m dl crypt;do \
  85. rm lib$$x.so; \
  86. rm lib$$x.so.0; \
  87. rm libuClib$$x.so; \
  88. done)
  89. #(cd debian/tmp/usr/$(target)-linux-uclibc/lib; \
  90. for x in libutil libc libm libdl libcrypt;do \
  91. rm $$x.so;done)
  92. # Build architecture-independent files here.
  93. binary-indep: build install
  94. # We have nothing to do by default.
  95. # Build architecture-dependent files here.
  96. binary-arch: build install
  97. # dh_testversion
  98. dh_testdir
  99. dh_testroot
  100. # dh_installdebconf
  101. dh_installdocs
  102. dh_installexamples
  103. dh_installmenu
  104. # dh_installemacsen
  105. # dh_installpam
  106. # dh_installinit
  107. dh_installcron
  108. # dh_installmanpages -plibuclibc0
  109. dh_installinfo
  110. # dh_undocumented
  111. dh_installchangelogs
  112. dh_link
  113. dh_strip
  114. dh_compress
  115. dh_fixperms
  116. # You may want to make some executables suid here.
  117. # dh_suidregister
  118. # dh_makeshlibs
  119. dh_installdeb
  120. # dh_perl
  121. dh_shlibdeps --exclude=ld_uclibc -ldebian/libuclibc0/lib
  122. dh_gencontrol
  123. dh_md5sums
  124. dh_builddeb
  125. binary: binary-indep binary-arch
  126. .PHONY: build clean binary-indep binary-arch binary install