Makefile 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. NAME=vbootstrap
  2. VERSION=$(shell awk '/%define version/ { print $$3 }' ${NAME}-vl.spec)
  3. REVISION=$(shell LC_ALL=C svn info 2> /dev/null | grep Revision | cut -d' ' -f2)
  4. VBUILDER_STABLE_VERSION=5.2
  5. VBUILDER_DEFAULT_VERSION=VineSeed
  6. VBUILDER_CATEGORIES=main,plus,nonfree
  7. VBUILDER_VBOOTSTRAP_DIR=/var/local/vbootstrap
  8. VBUILDER_UNIONFS_DIR=/var/local/vbootstrap/unionfs
  9. VBUILDER_CACHE_DIR=/var/local/vbootstrap/cache
  10. VBUILDER_BUILT_RPMS_DIR=$$\{HOME\}/rpm/vbuilder
  11. DESTDIR=
  12. all:
  13. sed -e "s/@@VBOOTSTRAP_VERSION@@/${VERSION}/g" \
  14. vbootstrap.sh.in > vbootstrap.sh
  15. for i in vbuilder.sh.in vbuilder.conf.in libvbuilder.sh.in; do \
  16. sed -e "s/@@VBUILDER_VERSION@@/${VERSION}/g" \
  17. -e "s/@@VBUILDER_REVISION@@/${REVISION}/g" \
  18. -e "s/@@VBUILDER_STABLE_VERSION@@/${VBUILDER_STABLE_VERSION}/g" \
  19. -e "s/@@VBUILDER_DEFAULT_VERSION@@/${VBUILDER_DEFAULT_VERSION}/g" \
  20. -e "s/@@VBUILDER_CATEGORIES@@/${VBUILDER_CATEGORIES}/g" \
  21. -e "s|@@VBUILDER_VBOOTSTRAP_DIR@@|${VBUILDER_VBOOTSTRAP_DIR}|g" \
  22. -e "s|@@VBUILDER_UNIONFS_DIR@@|${VBUILDER_UNIONFS_DIR}|g" \
  23. -e "s|@@VBUILDER_CACHE_DIR@@|${VBUILDER_CACHE_DIR}|g" \
  24. -e "s|@@VBUILDER_BUILT_RPMS_DIR@@|${VBUILDER_BUILT_RPMS_DIR}|g" \
  25. $$i > `basename $$i .in`; \
  26. done
  27. ##!! experimental: vchroot
  28. cp -f vchroot.sh.in vchroot.sh
  29. cd po && make
  30. install:
  31. install -d ${DESTDIR}/usr/share/vbootstrap/{scripts,sources.list.d}
  32. install -d ${DESTDIR}/usr/bin
  33. install -d ${DESTDIR}/usr/sbin
  34. install -d ${DESTDIR}/etc/vbootstrap
  35. install -d ${DESTDIR}/etc/security/console.apps
  36. install -d ${DESTDIR}/etc/pam.d
  37. install -d ${DESTDIR}/etc/bash_completion.d
  38. for sh in vbootstrap/scripts/*.sh; do \
  39. inst_sh=`basename $$sh .sh`; \
  40. install -m 644 $$sh ${DESTDIR}/usr/share/vbootstrap/scripts/$$inst_sh; \
  41. done
  42. install -m 644 vbootstrap/sources.list.d/* ${DESTDIR}/usr/share/vbootstrap/sources.list.d
  43. install -m 755 vbootstrap.sh ${DESTDIR}/usr/sbin/vbootstrap
  44. install -m 755 vbuilder.sh ${DESTDIR}/usr/sbin/vbuilder
  45. install -m 644 vbuilder.conf ${DESTDIR}/etc/vbootstrap/vbuilder.conf
  46. cd ${DESTDIR}/usr/bin && ln -sf consolehelper vbuilder
  47. install -m 644 vbuilder.console ${DESTDIR}/etc/security/console.apps/vbuilder
  48. install -m 644 vbuilder.pamd ${DESTDIR}/etc/pam.d/vbuilder
  49. install -m 644 vbuilder-bash-completion.sh ${DESTDIR}/etc/bash_completion.d/vbuilder
  50. ##!! experimental: vchroot
  51. install -m 644 libvbuilder.sh ${DESTDIR}/usr/share/vbootstrap/libvbuilder.sh
  52. install -m 755 vchroot.sh ${DESTDIR}/usr/sbin/vchroot
  53. cd po && make install DESTDIR=${DESTDIR}
  54. tarbz2: clean
  55. cd .. && rm -rf ${NAME}-${VERSION}
  56. cd .. && cp -arf trunk ${NAME}-${VERSION}
  57. cd .. && tar --exclude CVS --exclude .svn -cf - ${NAME}-${VERSION} | bzip2 -9 > ${NAME}-${VERSION}.tar.bz2
  58. @if [ -d ~/rpm/SOURCES/${NAME} ]; then \
  59. mv ../${NAME}-${VERSION}.tar.bz2 ~/rpm/SOURCES/${NAME}; \
  60. else \
  61. mv ../${NAME}-${VERSION}.tar.bz2 ~/rpm/SOURCES/; \
  62. fi
  63. rm -rf ${NAME}-${VERSION}
  64. rpm: tarbz2
  65. rpmbuild -ba ${NAME}-vl.spec
  66. clean:
  67. rm -fr *~ .*???~ vbootstrap.sh vbuilder.sh vbuilder.conf
  68. find . -name *~ -exec rm -f {} \;
  69. ##!! experimental: vchroot
  70. rm -f vchroot.sh libvbuilder.sh
  71. cd po && make clean