Makefile 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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=6.5
  5. VBUILDER_DEFAULT_VERSION=VineSeed
  6. VBUILDER_CATEGORIES=main,plus,nonfree
  7. VBUILDER_VBOOTSTRAP_FETCH_URL=http://updates.vinelinux.org/apt
  8. VBUILDER_VBOOTSTRAP_DIR=/var/local/vbootstrap
  9. VBUILDER_UNIONFS_DIR=/var/local/vbootstrap/unionfs
  10. VBUILDER_CACHE_DIR=/var/local/vbootstrap/cache
  11. VBUILDER_BUILT_RPMS_DIR=$$\{HOME\}/rpm/vbuilder
  12. DESTDIR=
  13. all:
  14. sed -e "s/@@VBOOTSTRAP_VERSION@@/${VERSION}/g" \
  15. vbootstrap.sh.in > vbootstrap.sh
  16. for i in vbuilder.sh.in vbuilder.conf.in libvbuilder.sh.in; do \
  17. sed -e "s/@@VBUILDER_VERSION@@/${VERSION}/g" \
  18. -e "s/@@VBUILDER_REVISION@@/${REVISION}/g" \
  19. -e "s/@@VBUILDER_STABLE_VERSION@@/${VBUILDER_STABLE_VERSION}/g" \
  20. -e "s/@@VBUILDER_DEFAULT_VERSION@@/${VBUILDER_DEFAULT_VERSION}/g" \
  21. -e "s|@@VBUILDER_VBOOTSTRAP_FETCH_URL@@|${VBUILDER_VBOOTSTRAP_FETCH_URL}|g" \
  22. -e "s/@@VBUILDER_CATEGORIES@@/${VBUILDER_CATEGORIES}/g" \
  23. -e "s|@@VBUILDER_VBOOTSTRAP_DIR@@|${VBUILDER_VBOOTSTRAP_DIR}|g" \
  24. -e "s|@@VBUILDER_UNIONFS_DIR@@|${VBUILDER_UNIONFS_DIR}|g" \
  25. -e "s|@@VBUILDER_CACHE_DIR@@|${VBUILDER_CACHE_DIR}|g" \
  26. -e "s|@@VBUILDER_BUILT_RPMS_DIR@@|${VBUILDER_BUILT_RPMS_DIR}|g" \
  27. $$i > `basename $$i .in`; \
  28. done
  29. ##!! experimental: vchroot
  30. cp -f vchroot.sh.in vchroot.sh
  31. cd po && make
  32. install:
  33. install -d ${DESTDIR}/usr/share/vbootstrap/{scripts,sources.list.d}
  34. install -d ${DESTDIR}/usr/bin
  35. install -d ${DESTDIR}/usr/sbin
  36. install -d ${DESTDIR}/etc/vbootstrap/profile.d
  37. install -d ${DESTDIR}/etc/security/console.apps
  38. install -d ${DESTDIR}/etc/pam.d
  39. install -d ${DESTDIR}/etc/bash_completion.d
  40. for sh in vbootstrap/scripts/*.sh; do \
  41. inst_sh=`basename $$sh .sh`; \
  42. install -m 644 $$sh ${DESTDIR}/usr/share/vbootstrap/scripts/$$inst_sh; \
  43. done
  44. install -m 644 vbootstrap/sources.list.d/* ${DESTDIR}/usr/share/vbootstrap/sources.list.d
  45. install -m 755 vbootstrap.sh ${DESTDIR}/usr/sbin/vbootstrap
  46. install -m 755 vbuilder.sh ${DESTDIR}/usr/sbin/vbuilder
  47. install -m 644 vbuilder.conf ${DESTDIR}/etc/vbootstrap/vbuilder.conf
  48. install -m 644 sample.conf.skip ${DESTDIR}/etc/vbootstrap/profile.d/sample.conf.skip
  49. cd ${DESTDIR}/usr/bin && ln -sf consolehelper vbuilder
  50. install -m 644 vbuilder.console ${DESTDIR}/etc/security/console.apps/vbuilder
  51. install -m 644 vbuilder.pamd ${DESTDIR}/etc/pam.d/vbuilder
  52. install -m 644 vbuilder-bash-completion.sh ${DESTDIR}/etc/bash_completion.d/vbuilder
  53. ##!! experimental: vchroot
  54. install -m 644 libvbuilder.sh ${DESTDIR}/usr/share/vbootstrap/libvbuilder.sh
  55. install -m 755 vchroot.sh ${DESTDIR}/usr/sbin/vchroot
  56. cd po && make install DESTDIR=${DESTDIR}
  57. tarbz2: clean
  58. cd .. && rm -rf ${NAME}-${VERSION}
  59. cd .. && cp -arf trunk ${NAME}-${VERSION}
  60. cd .. && tar --exclude CVS --exclude .svn -cf - ${NAME}-${VERSION} | bzip2 -9 > ${NAME}-${VERSION}.tar.bz2
  61. @if [ -d ~/rpm/SOURCES/${NAME} ]; then \
  62. mv ../${NAME}-${VERSION}.tar.bz2 ~/rpm/SOURCES/${NAME}; \
  63. else \
  64. mv ../${NAME}-${VERSION}.tar.bz2 ~/rpm/SOURCES/; \
  65. fi
  66. rm -rf ${NAME}-${VERSION}
  67. tarxz:
  68. git archive HEAD --prefix=${NAME}-${VERSION}/ --output=../${NAME}-${VERSION}.tar.xz
  69. @if [ -d ~/rpm/SOURCES/${NAME} ]; then \
  70. mv ../${NAME}-${VERSION}.tar.xz ~/rpm/SOURCES/${NAME}; \
  71. else \
  72. mv ../${NAME}-${VERSION}.tar.xz ~/rpm/SOURCES/; \
  73. fi
  74. rpm: tarxz
  75. rpmbuild -ba ${NAME}-vl.spec
  76. srpm: tarxz
  77. rpmbuild -bs ${NAME}-vl.spec
  78. clean:
  79. rm -fr *~ .*???~ vbootstrap.sh vbuilder.sh vbuilder.conf
  80. find . -name *~ -exec rm -f {} \;
  81. ##!! experimental: vchroot
  82. rm -f vchroot.sh libvbuilder.sh
  83. cd po && make clean