Discussion:
puzzled, gives file but does not make files/directories
ed
2008-01-04 12:18:23 UTC
Permalink
Goodday all.

I do not get it. Here is my spec file, which does do a
proper build.
Well at least, so it seems. But why the files and
directories are
not made from this rpm is puzzling me for weeks now. The
build
on the system goes well, but the rpm install on the target
does nothing
except the requested configuration file, but there is more.

System RH EL5 and there is of course a buildroot, and the
build enviroment
seems to be proper ( rpmbuild -ba -bb etc does not complain
)

Anyone has a pointer or hint to put me in the right
direction ?

regards, and best wishes for 2008, Ed de la Rie

xxxxx.spec

Name: xxxxx
Version: 0.4
Release: 0%
Source0: xxxxx.tar
BuildRoot: /var/tmp/buildroot-%{name}-%{version}

%description
This does something usefull

%prep

%setup -q -c

%build

%install

mkdir -p $RPM_BUILD_ROOT/var/lib/xxxxx
mkdir -p $RPM_BUILD_ROOT/var/log/xxxxx
touch $RPM_BUILD_ROOT/var/log/xxxxx-configure.log
chmod 600 $RPM_BUILD_ROOT/var/log/xxxxx
chmod 640 $RPM_BUILD_ROOT/var/log/xxxxx-configure.log

mkdir -p $RPM_BUILD_ROOT/etc/xxxxx/confs
mkdir -p $RPM_BUILD_ROOT/etc/xxxxx/ca.d
mkdir -p $RPM_BUILD_ROOT/etc/xxxxx/key.d
mkdir -p $RPM_BUILD_ROOT/etc/xxxxx/cert.d

cp /etc/pki/tls/private/*.key /etc/xxxxx/key.d
cp /etc/pki/tls/certs/*.crt /etc/xxxxx/cert.d
cp /etc/pki/certs/cacert.crt /etc/xxxxx/cert.d

openssl x509 -noout -hash -in /etc/xxxxx/cert.d/cacert.crt >
/etc/xxxxx/hash.txt
echo $(cat /etc/xxxxx/hash.txt).0 > /etc/xxxxx/hash.0.txt
ln -s /etc/xxxxx/cert.d/cacert.pem $(cat
/etc/xxxxx/hash.0.txt)


cat $RPM_SOURCE_DIR/xxxxx.tar | tar xvvf -

cp -r * $RPM_BUILD_ROOT
install -m644 %{SOURCE0} -D %{buildroot}/xxxxx.conf
%files
%attr(-,root,root)
/etc/xxxxx/xxxxx.conf

%post

sh /etc/init.d/xxxxx reload || true

%check
/bin/true

%clean

cat << EOF

System installed

EOF

%changelog
* Tue Dec 04 2007 Ed
- Version 0.3 prelimenary
Valery Reznic
2008-01-04 12:33:14 UTC
Permalink
Post by ed
Goodday all.
I do not get it. Here is my spec file, which does do
a
proper build.
Well at least, so it seems. But why the files and
directories are
not made from this rpm is puzzling me for weeks now.
The
build
on the system goes well, but the rpm install on the
target
does nothing
except the requested configuration file, but there
is more.
System RH EL5 and there is of course a buildroot,
and the
build enviroment
seems to be proper ( rpmbuild -ba -bb etc does not
complain
)
Anyone has a pointer or hint to put me in the right
direction ?
regards, and best wishes for 2008, Ed de la Rie
xxxxx.spec
Name: xxxxx
Version: 0.4
Release: 0%
Source0: xxxxx.tar
/var/tmp/buildroot-%{name}-%{version}
%description
This does something usefull
%prep
%setup -q -c
%build
%install
mkdir -p $RPM_BUILD_ROOT/var/lib/xxxxx
mkdir -p $RPM_BUILD_ROOT/var/log/xxxxx
touch
$RPM_BUILD_ROOT/var/log/xxxxx-configure.log
chmod 600 $RPM_BUILD_ROOT/var/log/xxxxx
chmod 640
$RPM_BUILD_ROOT/var/log/xxxxx-configure.log
mkdir -p $RPM_BUILD_ROOT/etc/xxxxx/confs
mkdir -p $RPM_BUILD_ROOT/etc/xxxxx/ca.d
mkdir -p $RPM_BUILD_ROOT/etc/xxxxx/key.d
mkdir -p $RPM_BUILD_ROOT/etc/xxxxx/cert.d
cp /etc/pki/tls/private/*.key /etc/xxxxx/key.d
cp /etc/pki/tls/certs/*.crt /etc/xxxxx/cert.d
cp /etc/pki/certs/cacert.crt /etc/xxxxx/cert.d
openssl x509 -noout -hash -in
/etc/xxxxx/cert.d/cacert.crt >
/etc/xxxxx/hash.txt
echo $(cat /etc/xxxxx/hash.txt).0 >
/etc/xxxxx/hash.0.txt
ln -s /etc/xxxxx/cert.d/cacert.pem $(cat
/etc/xxxxx/hash.0.txt)
cat $RPM_SOURCE_DIR/xxxxx.tar | tar xvvf
-
cp -r * $RPM_BUILD_ROOT
install -m644 %{SOURCE0} -D %{buildroot}/xxxxx.conf
%files
%attr(-,root,root)
/etc/xxxxx/xxxxx.conf
Files section specified which files should be packed.
You specify only one file, so it's only file in your
rpm.

Valery
Post by ed
%post
sh /etc/init.d/xxxxx reload || true
%check
/bin/true
%clean
cat << EOF
System installed
EOF
%changelog
* Tue Dec 04 2007 Ed
- Version 0.3 prelimenary
_______________________________________________
Rpm-list mailing list
https://www.redhat.com/mailman/listinfo/rpm-list
____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
Paul Johnson
2008-01-05 03:18:54 UTC
Permalink
Shouldn't this:

cp /etc/pki/tls/private/*.key /etc/xxxxx/key.d

be

cp /etc/pki/tls/private/*.key $RPM_BUILD_ROOT/etc/xxxxx/key.d

How else do you expect your files to get into the staging area?

Actually, I don't see how your build was succeeding at all, since you
are writing into /etc. You are not building this as root, are you?

rpmbuild would fail with "installed but unpackaged files found", I
think, unless you did something that intentionally disabled that.

pj
--
Paul E. Johnson
Professor, Political Science
1541 Lilac Lane, Room 504
University of Kansas
ed
2008-01-07 08:03:44 UTC
Permalink
hmm, I did build this as root.
Guess this needs some re-work.

Thanks for the help

----- Original Message Follows -----
From: "Paul Johnson" <***@gmail.com>
To: "RPM Package Manager" <rpm-***@redhat.com>
Subject: Re: puzzled, gives file but does not make
files/directories
Date: Fri, 4 Jan 2008 21:18:54 -0600
Post by ed
cp /etc/pki/tls/private/*.key /etc/xxxxx/key.d
be
cp /etc/pki/tls/private/*.key
$RPM_BUILD_ROOT/etc/xxxxx/key.d
How else do you expect your files to get into the staging
area?
Actually, I don't see how your build was succeeding at
all, since you are writing into /etc. You are not
building this as root, are you?
rpmbuild would fail with "installed but unpackaged files
found", I think, unless you did something that
intentionally disabled that.
pj
--
Paul E. Johnson
Professor, Political Science
1541 Lilac Lane, Room 504
University of Kansas
_______________________________________________
Rpm-list mailing list
https://www.redhat.com/mailman/listinfo/rpm-list
Loading...