pizza247
pizza247

Reputation: 3897

url2pkg returns "/opt/pkg/bin/url2pkg must be run from a package directory (.../pkgsrc/category/package)"

I'm on mac, and I'm trying to create a new package for pkgsrc. Every time I run url2pkg I get the message:

/opt/pkg/bin/url2pkg must be run from a package directory (.../pkgsrc/category/package). at /opt/pkg/bin/url2pkg line 517.

where do I need to run this from? It's not super clear to me. Do I need to make a pkgsrc directory?

I've tried creating new directories in root and also from /opt/pkg and I get this error in both places.

Upvotes: 0

Views: 130

Answers (2)

Roland Illig
Roland Illig

Reputation: 41686

To create a package in pkgsrc, you usually do this:

cd /usr/pkgsrc   # or wherever your installation of pkgsrc is
cd $some_category

mkdir mynewpackage
cd mynewpackage

url2pkg https://example.org/releases/mynewpackage-1.27.tar.gz

The reason that url2pkg needs to be run in exactly this directory is that it cannot know the category of the package in advance. It also doesn’t assume that the basename from the URL is the package to be created. And, since you will be editing the Makefile anyway, it is only convenient when you start working in that directory from the beginning.

Upvotes: 1

jac
jac

Reputation: 141

This needs to be run from pkgsrc/category/package. pkgsrc need to be complete.

For OS X the suggested practice seems to be cloning pkgsrc from the joyent/pkgsrc git repository.

$ git clone git://github.com/joyent/pkgsrc.git

Alternatively, you could get pkgsrc upstream from NetBSD.

  1. using cvs versioning:

$ cvs -q -z2 -d [email protected]:/cvsroot checkout -r pkgsrc-2016Q1 -P pkgsrc

  1. or as a tarball

NB. Due to low reputation I can't include more links such as a link to the tarball.

Upvotes: 1

Related Questions