You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

217 lines
6.6 KiB

  1. # $FreeBSD$
  2. #
  3. SUBDIR += accessibility
  4. SUBDIR += arabic
  5. SUBDIR += archivers
  6. SUBDIR += astro
  7. SUBDIR += audio
  8. SUBDIR += benchmarks
  9. SUBDIR += biology
  10. SUBDIR += cad
  11. SUBDIR += chinese
  12. SUBDIR += comms
  13. SUBDIR += converters
  14. SUBDIR += databases
  15. SUBDIR += deskutils
  16. SUBDIR += devel
  17. SUBDIR += dns
  18. SUBDIR += editors
  19. SUBDIR += emulators
  20. SUBDIR += finance
  21. SUBDIR += french
  22. SUBDIR += ftp
  23. SUBDIR += games
  24. SUBDIR += german
  25. SUBDIR += graphics
  26. SUBDIR += hardenedbsd
  27. SUBDIR += hebrew
  28. SUBDIR += hungarian
  29. SUBDIR += irc
  30. SUBDIR += japanese
  31. SUBDIR += java
  32. SUBDIR += korean
  33. SUBDIR += lang
  34. SUBDIR += mail
  35. SUBDIR += math
  36. SUBDIR += misc
  37. SUBDIR += multimedia
  38. SUBDIR += net
  39. SUBDIR += net-im
  40. SUBDIR += net-mgmt
  41. SUBDIR += net-p2p
  42. SUBDIR += news
  43. SUBDIR += polish
  44. SUBDIR += ports-mgmt
  45. SUBDIR += portuguese
  46. SUBDIR += print
  47. SUBDIR += russian
  48. SUBDIR += science
  49. SUBDIR += security
  50. SUBDIR += shells
  51. SUBDIR += sysutils
  52. SUBDIR += textproc
  53. SUBDIR += ukrainian
  54. SUBDIR += vietnamese
  55. SUBDIR += www
  56. SUBDIR += x11
  57. SUBDIR += x11-clocks
  58. SUBDIR += x11-drivers
  59. SUBDIR += x11-fm
  60. SUBDIR += x11-fonts
  61. SUBDIR += x11-servers
  62. SUBDIR += x11-themes
  63. SUBDIR += x11-toolkits
  64. SUBDIR += x11-wm
  65. PORTSTOP= yes
  66. .include <bsd.port.subdir.mk>
  67. index:
  68. @rm -f ${INDEXDIR}/${INDEXFILE}
  69. @cd ${.CURDIR} && ${MAKE} ${INDEXDIR}/${INDEXFILE}
  70. fetchindex: ${INDEXDIR}/${INDEXFILE}.bz2
  71. @bunzip2 < ${INDEXDIR}/${INDEXFILE}.bz2 > ${INDEXDIR}/${INDEXFILE} && \
  72. chmod a+r ${INDEXDIR}/${INDEXFILE} && ${RM} ${INDEXDIR}/${INDEXFILE}.bz2
  73. ${INDEXDIR}/${INDEXFILE}.bz2: .PHONY
  74. ${FETCHINDEX} ${INDEXDIR}/${INDEXFILE}.bz2 ${MASTER_SITE_INDEX}${INDEXFILE}.bz2
  75. MASTER_SITE_INDEX?= https://www.FreeBSD.org/ports/
  76. SETENV?= /usr/bin/env
  77. FETCHINDEX?= ${SETENV} ${FETCH_ENV} fetch -am -o
  78. .if !defined(INDEX_JOBS)
  79. INDEX_JOBS!= ${SYSCTL} -n kern.smp.cpus
  80. .endif
  81. .if !defined(INDEX_VERBOSE)
  82. INDEX_ECHO_MSG= true
  83. INDEX_ECHO_1ST= echo -n
  84. .else
  85. INDEX_ECHO_MSG= echo 1>&2
  86. INDEX_ECHO_1ST= echo
  87. .endif
  88. # /rescue/sh is statically linked and much faster to execute than the
  89. # dynamically linked /bin/sh. This is significant for targets like
  90. # make index that execute the shell tens of thousands of times.
  91. .if exists(/rescue/sh)
  92. INDEX_SHELL= /rescue/sh
  93. .else
  94. INDEX_SHELL= /bin/sh
  95. .endif
  96. .if !defined(INDEX_PORTS)
  97. INDEX_PORTS=.
  98. .endif
  99. .if exists(/usr/libexec/make_index)
  100. MAKE_INDEX= /usr/libexec/make_index /dev/stdin
  101. .else
  102. MAKE_INDEX= perl ${.CURDIR}/Tools/make_index
  103. .endif
  104. ${INDEXDIR}/${INDEXFILE}:
  105. @${INDEX_ECHO_1ST} "Generating ${INDEXFILE} - please wait.."; \
  106. if [ "${INDEX_PRISTINE}" != "" ]; then \
  107. export LOCALBASE=/nonexistentlocal; \
  108. fi; \
  109. tmpdir=`/usr/bin/mktemp -d -t index` || exit 1; \
  110. trap "rm -rf $${tmpdir}; exit 1" 1 2 3 5 10 13 15; \
  111. ( cd ${.CURDIR}; for i in ${INDEX_PORTS}; do (cd $${i} && ${MAKE} -j${INDEX_JOBS} INDEX_TMPDIR=$${tmpdir} BUILDING_INDEX=1 \
  112. __MAKE_SHELL=${INDEX_SHELL} \
  113. ECHO_MSG="${INDEX_ECHO_MSG}" describe); done ) || \
  114. (rm -rf $${tmpdir} ; \
  115. if [ "${INDEX_QUIET}" = "" ]; then \
  116. echo; \
  117. echo "********************************************************************"; \
  118. echo "Before reporting this error, verify that you are running a supported"; \
  119. echo "version of FreeBSD (see https://www.FreeBSD.org/ports/) and that you"; \
  120. echo "have a complete and up-to-date ports collection. (INDEX builds are"; \
  121. echo "not supported with partial or out-of-date ports collections."; \
  122. echo "If that is the case, then"; \
  123. echo "report the failure to ports@FreeBSD.org together with relevant"; \
  124. echo "details of your ports configuration (including FreeBSD version,"; \
  125. echo "your architecture, your environment, and your /etc/make.conf"; \
  126. echo "settings, especially compiler flags and OPTIONS_SET/UNSET settings)."; \
  127. echo; \
  128. echo "Note: the latest pre-generated version of INDEX may be fetched"; \
  129. echo "automatically with \"make fetchindex\"."; \
  130. echo "********************************************************************"; \
  131. echo; \
  132. fi; \
  133. exit 1); \
  134. cat $${tmpdir}/${INDEXFILE}.desc.* | \
  135. sed -e 's|${.CURDIR}|${PORTSDIR}|g' | \
  136. (cd ${.CURDIR} ; ${MAKE_INDEX}) | \
  137. sed -e 's/ */ /g' -e 's/| */|/g' -e 's/ *|/|/g' -e 's./..g' | \
  138. sort -t '|' -k 2,3 | \
  139. sed -Ee 's../.g' -e ':a' -e 's|/[^/]+/\.\.||; ta' \
  140. -e 's|${PORTSDIR}|/usr/ports|g' \
  141. -e 's|${.CURDIR}|/usr/ports|g' > ${INDEXDIR}/${INDEXFILE}.tmp; \
  142. if [ "${INDEX_PRISTINE}" != "" ]; then \
  143. sed -e "s,$${LOCALBASE},/usr/local," ${INDEXDIR}/${INDEXFILE}.tmp > ${INDEXDIR}/${INDEXFILE}; \
  144. else \
  145. mv ${INDEXDIR}/${INDEXFILE}.tmp ${INDEXDIR}/${INDEXFILE}; \
  146. fi; \
  147. rm -rf $${tmpdir}; \
  148. echo " Done."
  149. print-index: ${INDEXDIR}/${INDEXFILE}
  150. @awk -F\| '{ printf("Port:\t%s\nPath:\t%s\nInfo:\t%s\nMaint:\t%s\nIndex:\t%s\nB-deps:\t%s\nR-deps:\t%s\nE-deps:\t%s\nP-deps:\t%s\nF-deps:\t%s\nWWW:\t%s\n\n", $$1, $$2, $$4, $$6, $$7, $$8, $$9, $$11, $$12, $$13, $$10); }' < ${INDEXDIR}/${INDEXFILE}
  151. GIT?= git
  152. .if !defined(SVN) || empty(SVN)
  153. . for _P in /usr/bin /usr/local/bin
  154. . for _S in svn svnlite
  155. . if exists(${_P}/${_S})
  156. SVN= ${_P}/${_S}
  157. . endif
  158. . endfor
  159. . endfor
  160. .endif
  161. RSYNC?= rsync
  162. PORTSNAP?= portsnap
  163. PORTSNAP_FLAGS?= -p ${.CURDIR}
  164. .if !target(update)
  165. update:
  166. .if exists(${.CURDIR}/.svn)
  167. @echo "--------------------------------------------------------------"
  168. @echo ">>> Updating ${.CURDIR} using Subversion"
  169. @echo "--------------------------------------------------------------"
  170. cd ${.CURDIR}; ${SVN} update
  171. .elif exists(${.CURDIR}/.git)
  172. . if exists(${.CURDIR}/.git/svn)
  173. @echo "--------------------------------------------------------------"
  174. @echo ">>> Updating ${.CURDIR} from git+svn repository"
  175. @echo "--------------------------------------------------------------"
  176. cd ${.CURDIR}; ${GIT} svn rebase
  177. . else
  178. @echo "--------------------------------------------------------------"
  179. @echo ">>> Updating ${.CURDIR} from git repository"
  180. @echo "--------------------------------------------------------------"
  181. cd ${.CURDIR}; ${GIT} pull
  182. . endif
  183. .elif defined(RSYNC_UPDATE) && defined(PORTS_RSYNC_SOURCE)
  184. @echo "--------------------------------------------------------------"
  185. @echo ">>> Updating with ${RSYNC} from ${PORTS_RSYNC_SOURCE}"
  186. @echo "--------------------------------------------------------------"
  187. @${RSYNC} ${RSYNC_FLAGS} ${PORTS_RSYNC_SOURCE}/ ${.CURDIR}/
  188. .else
  189. @echo "--------------------------------------------------------------"
  190. @echo ">>> Running ${PORTSNAP}"
  191. @echo "--------------------------------------------------------------"
  192. .if !exists(${PORTSDIR}/.portsnap.INDEX)
  193. @echo "Error: 'make update' uses portsnap(8) by default and"
  194. @echo "needs ${PORTSDIR} to be created by portsnap on its first run."
  195. @echo "Please run 'portsnap fetch extract' first."
  196. .else
  197. @${PORTSNAP} ${PORTSNAP_FLAGS} fetch
  198. @${PORTSNAP} ${PORTSNAP_FLAGS} update
  199. .endif
  200. .endif
  201. .endif