Thursday Dec 17, 2009

hping3 In /pending Repo

It'd been a while since I put something into the OpenSolaris Source Juicer (SJ). Recently I was doing some audits on a personal system, rekindling an on-again/off-again flirting with computer security, and thought it'd be good to have a readily installable hping3 package for OpenSolaris. It's an oldie but goodie. It's in the /pending repo at the moment. After some testing, I will get it promoted to /contrib.

I also have plans to get libnids and dnsiff into SJ...once an issue with the SUNWlibnet package gets sorted out.

:wq

Tuesday Aug 04, 2009

%attr boy

A few weeks ago, I blogged about my initial port of dmidecode into the SourceJuicer (SJ). Since then, I've been working on getting the package "promoted" to the /contrib repository. While doing this, I learned a bit about the %attr directives.

One of the comments I'd gotten was to tighten up the permissions on the binaries and man pages. In the initial port, the spec file did this for the packaging:

%files %defattr (-, root, bin) %doc AUTHORS CHANGELOG README %dir %attr(0755, root, bin) %{_sbindir} %{_sbindir}/\* %dir %attr(0755, root, bin) %{_mandir} %{_mandir}/\*/\*

While the directory attributes were explicitly set, the file attributes weren't. So I tried this:

%files %defattr (-, root, bin) %doc AUTHORS CHANGELOG README %dir %attr(0755, root, bin) %{_sbindir} %attr(0555, root, bin) %{_sbindir}/\* %{_sbindir}/\* %dir %attr(0755, root, bin) %{_mandir} %attr(0444, root, bin) %{_mandir}/\*/\* %{_mandir}/\*/\*

Wonderful. Now the permissions are tighter on the binaries and man pages. However, the SJ build was quite unhappy.

pkgbuild: Creating packages... pkgbuild: pkgbuild: File listed twice: usr/sbin/biosdecode pkgbuild: pkgbuild: File listed twice: usr/sbin/dmidecode pkgbuild: pkgbuild: File listed twice: usr/sbin/ownership pkgbuild: pkgbuild: File listed twice: usr/sbin/vpddecode pkgbuild: pkgbuild: File listed twice: usr/share/man/man8/biosdecode.8 pkgbuild: pkgbuild: File listed twice: usr/share/man/man8/dmidecode.8 pkgbuild: pkgbuild: File listed twice: usr/share/man/man8/ownership.8 pkgbuild: pkgbuild: File listed twice: usr/share/man/man8/vpddecode.8

After quite a bit of trial and error, I realized that when the %attr directive is used for a file or set of files, the files the directive references are included in the package. So the final %files section is:

%files %defattr (-, root, bin) %doc AUTHORS CHANGELOG README %dir %attr(0755, root, bin) %{_sbindir} %attr(0555, root, bin) %{_sbindir}/\* %dir %attr(0755, root, bin) %{_mandir} %attr(0444, root, bin) %{_mandir}/man8/\*

The moral of the story is that when using %attr you don't need (and don't want :) individual lines listing the sames files for inclusion in the package.

:wq

About

user9148476

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today