DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD Packages and Ports

OpenBSD Packages and Ports Installation and upgrading of packages and ports on OpenBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 12th March 2012
sparky's Avatar
sparky sparky is offline
Fdisk Soldier
 
Join Date: Mar 2012
Posts: 73
Thanked 0 Times in 0 Posts
Default Using Ports are there any tools (newbie)

Hi,

I'm having a bit of difficulty in understanding the OpenBSD way of using "ports"......


Actually in all truth and honesty I'm lost




So apart from the standard package tools:

pkg_add, pkg_info etc.....

how do I fetch the Ports collection or Ports tree???


I'm running OpenBSD RELEASE 5.0 x64 under VirtualBox and using it as a learning platform.


What is confusing is that there are no tools such as portsnap or portmanager in order to handle the downloading and building and management of ports.


Currently what I've done in order to get packages is add this line to my .profile:

Code:
export PKG_PATH=ftp://ftp.mirrorservice.org/pub/OpenBSD/5.0/packages/`machine -a`/
now packages can be installed by using pkg_add <pkg> without any issue.... but if there is software that I would like to install eg. lcdproc (which is claimed to be able to install under OpenBSD) I got recommended to "create a port" rather then "hand compile".


Unfortunately I'm too new to OpenBSD to know what that means using this OS....

My previous experience I would put the source code into the /usr/ports/distfiles folder; but there isn't a /usr/ports/ directory on OpenBSD so I'm totally lost.


Could anyone help me making sense of this or perhaps help me understanding the different mentality here?


Many thanks.

Kaya
Reply With Quote
  #2   (View Single Post)  
Old 12th March 2012
sparky's Avatar
sparky sparky is offline
Fdisk Soldier
 
Join Date: Mar 2012
Posts: 73
Thanked 0 Times in 0 Posts
Default

Sorry wanted to add these as things I've read but couldn't till now (post 5+):



http://www.openbsd.org/faq/faq5.html

http://www.openbsd.org/faq/ports/

http://www.openbsd.org/faq/ports/differences.html#Fetch

http://www.openbsd.org/cgi-bin/man.c...=1&format=html


Would I be correct in assuming that in order to build a port I would need to run:

Code:
pkg_create <source.tar.gz>
or I am tangentionally off??
Reply With Quote
  #3   (View Single Post)  
Old 12th March 2012
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 3,719
Thanked 214 Times in 189 Posts
Default

Off. The pkg_create(1) application is normally used under the covers by the porting infrastructure during make(1) with the package target, and almost never by a port developer.

You've missed FAQ 15 -- or you read it and were confused -- it wasn't in your list of documents you've reviewed. There's great guidance there.

In order to "use" the ports tree, you must first obtain a ports tree that is synced to the flavor of the OS you are using. (You can only mix and match -stable and -release, as they use the same underlying libraries.)

For -release, you can download and unpack the ports tarball. For -stable, you must use cvs(1). For -current, there is a daily tarball but cvs may be more convenient.

Note: There is usually little difference between the -release and -stable ports trees; for the last several years there hasn't been sufficient resources to develop -stable ports except when there has been a security issue with some port.
Reply With Quote
  #4   (View Single Post)  
Old 12th March 2012
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 3,719
Thanked 214 Times in 189 Posts
Default

Ooh, I forgot to mention, you'll want to review the ports(7) and bsd.ports.mk(5) man pages; the latter is critical if you are developing your own ports.
Reply With Quote
  #5   (View Single Post)  
Old 12th March 2012
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 2,888
Thanked 190 Times in 160 Posts
Default

Quote:
Originally Posted by sparky View Post
how do I fetch the Ports collection or Ports tree???
"Ports" refers to the source code + Makefile infrastructure needed to build third-party applications sanctioned by the OpenBSD project. "Packages" are the result of building ports.

Most users of OpenBSD should only be concerned about installing packages which is covered in Section 15 of the project's official FAQ. Rarely should general users need to build from the ports tree.

Repeating, the build process builds packages before installation. These are the same packages available on the mirror sites, so unless there is a specific reason to build, most users should be installing from the mirror sites as opposed to building themselves.
Quote:
What is confusing is that there are no tools such as portsnap or portmanager in order to handle the downloading and building and management of ports.
pkg_add(1), pkg_info(1), & pkg_delete(1) all deal with the management of packages. The ports tree itself is updated via cvs(1) commmands as discussed in Section 5.3.3 of the FAQ. If you have the official CD set, the ports tree can be found & installed from there.
Quote:
My previous experience I would put the source code into the /usr/ports/distfiles folder; but there isn't a /usr/ports/ directory on OpenBSD so I'm totally lost.
The ports tree (/usr/ports/) is not installed as part of the installation process. This will need to be manually added according to Section 5.3.3 as previously mentioned.

The FAQ is the single best starting point for newcomers to OpenBSD. You will save yourself significant time & aggravation by taking the time now to study its contents.
Reply With Quote
  #6   (View Single Post)  
Old 12th March 2012
sparky's Avatar
sparky sparky is offline
Fdisk Soldier
 
Join Date: Mar 2012
Posts: 73
Thanked 0 Times in 0 Posts
Default

Ok I checked FAQ15 out.

Got the "ports" tree installed by doing this according to the guide:

{I used /home as there was more space in it then /tmp where the tar.gz wouldn't fit}

Code:
cd /home
tar -C /usr -xzf ports.tar.gz

# chgrp -R wsrc /usr/ports
# find /usr/ports -type d -exec chmod g+w {} \;

echo "USE_SYSTRACE=Yes" > /etc/mk.conf

$ cd /usr/ports
$ make search key=rsnapshot

So now it should work like how I'm used to!


However, a quick question is - if I want to install a package not in the ports tree can I still build it as though it was a port?

eg. download the source into /usr/ports dir then run "make install clean" after going to /usr/ports/<source>
Reply With Quote
  #7   (View Single Post)  
Old 12th March 2012
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 3,719
Thanked 214 Times in 189 Posts
Default

No, sparky.

The ports tree contains infrastructure for building ports, not the ports' source code, and each leaf of the tree contains a series of OpenBSD-specific files/folders specific to that port, such as a Makefile, a distinfo file, and packing lists and installation messages in pkg/*, as well as optional patches/* or files/* when needed for OpenBSD uniquely.

Your choice with custom applications is to either:
  • build them outside the ports system entirely
  • "port" them.
The latter is what the porter's guide you were looking at is for.

Please read FAQ 15's sections on ports very carefully.

Last edited by jggimi; 12th March 2012 at 06:54 PM. Reason: typo, clarity
Reply With Quote
  #8   (View Single Post)  
Old 12th March 2012
sparky's Avatar
sparky sparky is offline
Fdisk Soldier
 
Join Date: Mar 2012
Posts: 73
Thanked 0 Times in 0 Posts
Default

Thanks a lot jggimi!

I understand now, at least better how things work.


I kinda had a secret agenda to be able to get LCDproc working in OpenBSD but since I was already running it on **other** platforms I was already signed up to the mailling list meaning that a quick question as to why the software wasn't compiling got me the response that I needed to use the CVS version.


Now all is fine and I have managed to compile my first piece of software without errors on OpenBSD.


Many thanks for the support.


Still a loooooong way to go though as it's a steep learning curve!
Reply With Quote
  #9   (View Single Post)  
Old 12th March 2012
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 3,719
Thanked 214 Times in 189 Posts
Default

Yes, it's a learning curve. But I'll beat the horse once more ... I thought I heard it sigh.

The FAQ is the only official "HOWTO" collection. You'll save yourself lots of time and shorten that learning curve by spending time with it.

As far as LCDProc goes, while I know nothing about it, I know that Edd Barrett was developing a port for it in November:

http://marc.info/?t=132173736200033&r=1&w=2
Reply With Quote
Old 13th March 2012
sparky's Avatar
sparky sparky is offline
Fdisk Soldier
 
Join Date: Mar 2012
Posts: 73
Thanked 0 Times in 0 Posts
Default

Quote:
Yes, it's a learning curve. But I'll beat the horse once more ... I thought I heard it sigh.

The FAQ is the only official "HOWTO" collection. You'll save yourself lots of time and shorten that learning curve by spending time with it.
I will try and do my best to understand everything written!

Quote:
As far as LCDProc goes, while I know nothing about it, I know that Edd Barrett was developing a port for it in November:
Apparently it will be **officially** released in OpenBSD 5.1.....

So finally when I come to buliding my Cisco killer 10GbE router it should be out.

I like LCD panels as they're a good way of getting info without typing and they look pretty in racks/general!
Reply With Quote
Old 13th March 2012
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 2,888
Thanked 190 Times in 160 Posts
Default

Quote:
Originally Posted by sparky View Post
Apparently it will be **officially** released in OpenBSD 5.1.....
This statement is partially correct. Given that lcdproc is checked into the ports CVS branch now:

http://www.openbsd.org/cgi-bin/cvswe...dproc/Makefile

It is already officially available to users of -current.

However, you should note where the OPENBSD_5_1_BASE CVS tag is placed (as this denotes what will be available with OpenBSD 5.1-release). The very latest lcdproc check-in made two weeks ago is newer than the 5.1 CVS tag; thus, this particular check-in is only available to -current users.

Is this check-in important? I don't know as I don't use lcdproc. The point here is that development of the port is actively on-going.

If you are confused by the different flavors of OpenBSD: -release, -stable, & -current, study Section 5.1 of the FAQ.

Last edited by ocicat; 13th March 2012 at 01:39 AM.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
FreeBSD Complete ports thaw after ports freeze for 7.3 Release J65nko News 0 24th March 2010 11:46 PM
PF Configuration for newbie slakic OpenBSD Security 1 20th August 2009 02:35 PM
UML tools bichumo Programming 2 12th September 2008 02:23 PM
Newbie NAT problem TiN-MAN FreeBSD Installation and Upgrading 2 26th June 2008 06:42 AM
Benchmarking Tools JMJ_coder NetBSD General 8 16th June 2008 10:42 PM


All times are GMT. The time now is 06:03 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick