wiki:CommittersGuide/Distfiles

Version 3 (modified by krischik@…, 15 years ago) (diff)

--

The content of each ports "files" directory should be keept fairly small as it is kopied to every MacPort user harddrive. If larger patches - for example application bundles with icon files are supplied then they should be added to distfiles so they are only donwloaded by those user who are actualy installing the Port.

Setup Repository

First setup a personal Subversion repository to maintain the files. Inside your Subversion repository you should create a directory with the portfiles name. Also create a directory for the Port you work on inside the distfile area of the subversion repository. You can use the commands below to do so:

Repository=http://svn.macosforge.org/repository/macports
User=userid
Port=portid

svn mkdir --username ${User}@macports.org -m"Create staging for ${Port}" ${Repository}/users/${User}/${Port}
svn mkdir --username ${User}@macports.org -m"Create distfiles for ${Port}" ${Repository}/distfiles/${Port}

Replace userid and portid with your own userid and the Port you are working on.

Prepare files

Prepare the files you want to distribute inside your personal Subversion repository and commit them back into Subversion. Then export them again. Export is needed so unnessesary svn meta data is not distributed. The exported files should then be packed. To keep the Portfile easy it is better to use the same archiver as is used for the main source file. You can use the following commands to do so:

Repository=http://svn.macports.org/repository/macports
User=userid
Port=portid
Version=12345

alias tar=/opt/local/bin/gnutar
alias mv=/opt/local/bin/gmv
alias rm=/opt/local/bin/grm

svn export ${Repository}/users/${User}/${Port}
mv --verbose ${Port} ${Port}-r${in_Version}
tar --create --gzip --file="${Port}-r${Version}.tar.gz" "${Port}-r${in_Version}"
svn import -m"Add distfile for ${Port}" "${Port}-r${Version}.tar.gz" "${Repository}/distfiles/${Port}/${Port}-r${Version}.tar.gz"
echo rm --verbose --recursive "${Port}"

Replace 12345 with a unique version identifier and userid and portid as you did before. Use Upload.command outlines one way on how to automate the whole process.