make-plist.sh 943 B

12345678910111213141516171819
  1. #!/bin/sh
  2. # taken from
  3. #http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/book.html#PLIST-DYNAMIC
  4. mkdir /var/tmp/$(make -V PORTNAME)
  5. mtree -U -f $(make -V MTREE_FILE) -d -e -p /var/tmp/$(make -V PORTNAME)
  6. make depends PREFIX=/var/tmp/$(make -V PORTNAME)
  7. #Store the directory structure in a new file.
  8. (cd /var/tmp/$(make -V PORTNAME) && find -d * -type d) | sort > OLD-DIRS
  9. touch pkg-plist
  10. #If your port honors PREFIX (which it should) you can then install the
  11. #port and create the package list.
  12. make install PREFIX=/var/tmp/$(make -V PORTNAME)
  13. (cd /var/tmp/$(make -V PORTNAME) && find -d * \! -type d) | sort > pkg-plist
  14. #You must also add any newly created directories to the packing list.
  15. (cd /var/tmp/$(make -V PORTNAME) && find -d * -type d) | sort | comm -13 OLD-DIRS - |
  16. sort -r | sed -e 's#^#@dirrm #' >> pkg-plist
  17. #Clean package
  18. make deinstall PREFIX=/var/tmp/$(make -V PORTNAME)
  19. rm -rf /var/tmp/$(make -V PORTNAME)