Makefile 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. NAME=vbootstrap
  2. VERSION=$(shell awk '/%define version/ { print $$3 }' ${NAME}.spec)
  3. VBUILDER_VBOOTSTRAP_DIR=/var/local/vbootstrap
  4. VBUILDER_DEFAULT_VERSION=VineSeed
  5. DESTDIR=
  6. all:
  7. sed -e "s/@@VBOOTSTRAP_VERSION@@/${VERSION}/g" vbootstrap.sh.in > vbootstrap.sh
  8. sed -e "s/@@VBUILDER_DEFAULT_VERSION@@/${VBUILDER_DEFAULT_VERSION}/g" \
  9. -e "s|@@VBUILDER_VBOOTSTRAP_DIR@@|${VBUILDER_VBOOTSTRAP_DIR}|g" \
  10. vbuilder.sh.in > vbuilder.sh
  11. sed -e "s/@@VBUILDER_DEFAULT_VERSION@@/${VBUILDER_DEFAULT_VERSION}/g" \
  12. -e "s|@@VBUILDER_VBOOTSTRAP_DIR@@|${VBUILDER_VBOOTSTRAP_DIR}|g" \
  13. vbuilder.conf.in > vbuilder.conf
  14. install:
  15. install -d ${DESTDIR}/usr/share/vbootstrap/{scripts,sources.list.d}
  16. install -d ${DESTDIR}/usr/sbin
  17. install -d ${DESTDIR}/etc/vbootstrap
  18. install -m 644 vbootstrap/scripts/* ${DESTDIR}/usr/share/vbootstrap/scripts/
  19. install -m 644 vbootstrap/sources.list.d/* ${DESTDIR}/usr/share/vbootstrap/sources.list.d
  20. install -m 755 vbootstrap.sh ${DESTDIR}/usr/sbin/vbootstrap
  21. install -m 755 vbuilder.sh ${DESTDIR}/usr/sbin/vbuilder
  22. install -m 644 vbuilder.conf ${DESTDIR}/etc/vbootstrap/vbuilder.conf
  23. tarbz2: clean
  24. cd .. && rm -rf ${NAME}-${VERSION}
  25. cd .. && cp -arf trunk ${NAME}-${VERSION}
  26. cd .. && tar --exclude CVS --exclude .svn -cf - ${NAME}-${VERSION} | bzip2 -9 > ${NAME}-${VERSION}.tar.bz2
  27. @if [ -d ~/rpm/SOURCES/${NAME} ]; then \
  28. mv ../${NAME}-${VERSION}.tar.bz2 ~/rpm/SOURCES/${NAME}; \
  29. else \
  30. mv ../${NAME}-${VERSION}.tar.bz2 ~/rpm/SOURCES/; \
  31. fi
  32. rm -rf ${NAME}-${VERSION}
  33. rpm: tarbz2
  34. rpm -ba ${NAME}.spec
  35. clean:
  36. rm -fr *~ .*???~ vbootstrap.sh vbuilder.sh vbuilder.conf