Makefile 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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.1
  5. VBUILDER_DEFAULT_VERSION=VineSeed
  6. VBUILDER_CATEGORIES=main,plus,nonfree
  7. VBUILDER_VBOOTSTRAP_DIR=/var/local/vbootstrap
  8. #VBUILDER_CACHE_DIR=$$\{VBOOTSTRAP_DIR\}/cache
  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" vbootstrap.sh.in > vbootstrap.sh
  14. sed -e "s/@@VBUILDER_STABLE_VERSION@@/${VBUILDER_STABLE_VERSION}/g" \
  15. -e "s/@@VBUILDER_DEFAULT_VERSION@@/${VBUILDER_DEFAULT_VERSION}/g" \
  16. -e "s/@@VBUILDER_CATEGORIES@@/${VBUILDER_CATEGORIES}/g" \
  17. -e "s|@@VBUILDER_VBOOTSTRAP_DIR@@|${VBUILDER_VBOOTSTRAP_DIR}|g" \
  18. -e "s|@@VBUILDER_CACHE_DIR@@|${VBUILDER_CACHE_DIR}|g" \
  19. -e "s|@@VBUILDER_BUILT_RPMS_DIR@@|${VBUILDER_BUILT_RPMS_DIR}|g" \
  20. vbuilder.sh.in > vbuilder.sh
  21. sed -e "s/@@VBUILDER_DEFAULT_VERSION@@/${VBUILDER_DEFAULT_VERSION}/g" \
  22. -e "s/@@VBUILDER_CATEGORIES@@/${VBUILDER_CATEGORIES}/g" \
  23. -e "s|@@VBUILDER_VBOOTSTRAP_DIR@@|${VBUILDER_VBOOTSTRAP_DIR}|g" \
  24. -e "s|@@VBUILDER_CACHE_DIR@@|${VBUILDER_CACHE_DIR}|g" \
  25. -e "s|@@VBUILDER_BUILT_RPMS_DIR@@|${VBUILDER_BUILT_RPMS_DIR}|g" \
  26. vbuilder.conf.in > vbuilder.conf
  27. install:
  28. install -d ${DESTDIR}/usr/share/vbootstrap/{scripts,sources.list.d}
  29. install -d ${DESTDIR}/usr/sbin
  30. install -d ${DESTDIR}/etc/vbootstrap
  31. install -d ${DESTDIR}/etc/bash_completion.d
  32. install -m 644 vbootstrap/scripts/* ${DESTDIR}/usr/share/vbootstrap/scripts/
  33. install -m 644 vbootstrap/sources.list.d/* ${DESTDIR}/usr/share/vbootstrap/sources.list.d
  34. install -m 755 vbootstrap.sh ${DESTDIR}/usr/sbin/vbootstrap
  35. install -m 755 vbuilder.sh ${DESTDIR}/usr/sbin/vbuilder
  36. install -m 644 vbuilder.conf ${DESTDIR}/etc/vbootstrap/vbuilder.conf
  37. install -m 644 vbuilder-bash-completion.sh ${DESTDIR}/etc/bash_completion.d/vbuilder
  38. tarbz2: clean
  39. cd .. && rm -rf ${NAME}-${VERSION}
  40. cd .. && cp -arf trunk ${NAME}-${VERSION}
  41. cd .. && tar --exclude CVS --exclude .svn -cf - ${NAME}-${VERSION} | bzip2 -9 > ${NAME}-${VERSION}.tar.bz2
  42. @if [ -d ~/rpm/SOURCES/${NAME} ]; then \
  43. mv ../${NAME}-${VERSION}.tar.bz2 ~/rpm/SOURCES/${NAME}; \
  44. else \
  45. mv ../${NAME}-${VERSION}.tar.bz2 ~/rpm/SOURCES/; \
  46. fi
  47. rm -rf ${NAME}-${VERSION}
  48. rpm: tarbz2
  49. rpmbuild -ba ${NAME}-vl.spec
  50. clean:
  51. rm -fr *~ .*???~ vbootstrap.sh vbuilder.sh vbuilder.conf