You are not logged in.

#1 2017-04-19 16:48:25

IrvineHimself
Member
From: Scotland
Registered: 2016-08-21
Posts: 275

[Solved] Help with a PCKGBUILD: mkdir: cannot create directory

I was trying to install Tripwire from Git Hub. In testing, I can compile the package, but to install it, I want to use the ABS.

Using my PCKGBUILD, once again, there does not appear to be a problem with make, but when it gets to the install part of the PCKGBUILD, things go down hill rapidly.

After make is finished, I get the following

......
Installer program for:
Tripwire(R) 2.4 Open Source

Copyright (C) 1998-2017 Tripwire, Inc.
Tripwire is a registered trademark of Tripwire, Inc. All rights reserved.


LICENSE AGREEMENT for Tripwire(R) 2.4 Open Source

Please read the following license agreement.  You must accept the
agreement to continue installing Tripwire.

Press ENTER to view the License Agreement.



Please type "accept" to indicate your acceptance of this
license agreement. [do not accept] accept
Using configuration file ./installer/install.cfg

Checking for programs specified in install configuration file....

/usr/sbin/sendmail -oi -t exists.  Continuing installation.

/usr/bin/vi exists.  Continuing installation.


----------------------------------------------
Verifying existence of binaries...

./bin/siggen found
./bin/tripwire found
./bin/twprint found
./bin/twadmin found

This program will copy Tripwire files to the following directories:

        TWBIN: /usr/sbin
        TWMAN: /usr/man
     TWPOLICY: /usr/etc
     TWREPORT: /usr/lib/tripwire/report
         TWDB: /usr/lib/tripwire
 TWSITEKEYDIR: /usr/etc
TWLOCALKEYDIR: /usr/etc

CLOBBER is true.

Continue with installation? [y/n] y

----------------------------------------------
Creating directories...

/usr/sbin: already exists
mkdir: cannot create directory ‘/usr/etc’: Permission denied
Error: unable to create directory /usr/etc
make[3]: *** [Makefile:802: install-data-hook] Error 1
make[3]: Leaving directory '/home/memyself/GitClones/Tripwire-Abs/src/tripwire-open-source'
make[2]: *** [Makefile:730: install-data-am] Error 2
make[2]: Leaving directory '/home/memyself/GitClones/Tripwire-Abs/src/tripwire-open-source'
make[1]: *** [Makefile:683: install-am] Error 2
make[1]: Leaving directory '/home/memyself/GitClones/Tripwire-Abs/src/tripwire-open-source'
make: *** [Makefile:385: install-recursive] Error 1
==> ERROR: A failure occurred in package().
    Aborting...

My PCKGBUILD is as follows:

pkgname=tripwire-open-source
pkgver=1
pkgrel=1
arch=('i686' 'x86_64')
url="https://github.com/Tripwire/tripwire-open-source"
license=('GPL2')
source=("git+https://github.com/Tripwire/tripwire-open-source.git")
md5sums=('SKIP')

build() {
	cd ${srcdir}/$pkgname
	#overwrite existing tripwire files (see install.cfg or https://github.com/frlinux/tripwire/blob/master/install/install.cfg
        sed -i 's/CLOBBER=false/CLOBBER=true/g' installer/install.cfg
        sh autogen.sh
        # tried adding  --sbindir=/usr/bin to ./configure
	./configure --prefix=/usr
	make
}

package() {
	cd ${srcdir}/$pkgname
        # tried adding /usr to $pkgdir
	make DESTDIR="$pkgdir-$pkgver/" install
}

Is it anything to do with autogen?

I would be grateful for your wisdom. Thanks in advance
Irvine

Last edited by IrvineHimself (2017-04-19 17:42:48)


Et voilà, elle arrive. La pièce, le sous, peut-être qu'il arrive avec vous!

Offline

#2 2017-04-19 16:52:03

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,466

Re: [Solved] Help with a PCKGBUILD: mkdir: cannot create directory

PKGBUILDs don't install things. They make a package, which is staged under $pkgdir. All changes should be made there.

Edit, misread. What the hell is $pkgdir-$pkgver supposed to be?

Last edited by Scimmia (2017-04-19 16:53:46)

Offline

#3 2017-04-19 16:52:24

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,449
Website

Re: [Solved] Help with a PCKGBUILD: mkdir: cannot create directory

your DESTDIR is the problem - it should just be "DESTDIR=$pkgdir".  See the wiki or any examples.

You would *not* add /usr to DESTDIR.  You may add it as PREFIX (or --prefix for configure).  I'm checking which of these would be appropriate now.

EDIT: WTF is that?!  It's GPL licensed code that superficially uses autotools - but it somehow breaks autotools to do it's own thing so that you have to view the GPL license in an editor then explicitly type "accept" to accept the license.  It also ignores all the destination directories set by configure and/or autotools settings.  That is just ridiculously broken upstream.

It seems to dump it's own install script into /tmp/ then run that script for all makefile install directives.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#4 2017-04-19 17:36:25

IrvineHimself
Member
From: Scotland
Registered: 2016-08-21
Posts: 275

Re: [Solved] Help with a PCKGBUILD: mkdir: cannot create directory

Scimmia wrote:

.....What the hell is $pkgdir-$pkgver supposed to be?

Whoops, I am still learning this. I was playing around to try to get it to work and inadvertently added -$pckver to $pckgdir rather than $pckgname.

Trilby wrote:

..... EDIT: WTF is that?!  It's GPL licensed code that superficially uses autotools - but it somehow breaks autotools to do it's own thing so that you have to view the GPL license in an editor then explicitly type "accept" to accept the license.  It also ignores all the destination directories set by configure and/or autotools settings.  That is just ridiculously broken upstream.

It seems to dump it's own install script into /tmp/ then run that script for all makefile install directives.

I'm on a mission to upgrade the security on my laptop, and have installed Rkhunter, which uses Tripwire as an optional dependency The AUR package is broken and, after searching around, I thought they had moved the project to Git Hub. I can see where you are coming from with your comments and  am giving this whole thing up as a bad joke.

Feel free to  close this post.

By the way, I have learned lesson here about blindly trusting Google.

Thanks for your reply's
Irvine


Et voilà, elle arrive. La pièce, le sous, peut-être qu'il arrive avec vous!

Offline

#5 2017-04-19 18:23:45

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,449
Website

Re: [Solved] Help with a PCKGBUILD: mkdir: cannot create directory

No need to close the thread - it is a perfectly valid question.  It's certainly not your fault that the upstream source for this has such poorly designed build tools.  If you really want to use tripwire it does build successfully, so you could just move the needed files over to $pkgdir in the build function.  There is precedent for this with other packages*.  But I'd just really be concerned with the quality of software coming from someone who botches the build system that badly.

I'm also not really sure what tripwire does.  The description says it monitors for changes to parts of a filesystem.  There are much simpler and better tools to accomplish this - checkout inotify if you want to monitor for and respond to changes to files.

*edit: actually this is what the current PKGBUILD in the AUR does.  If you do want to try tripwire, I bet using that as a starting point would make this pretty simple.

edit2: the current AUR PKGBUILD works fine with just a change to lines 62 and 63 to change the path from install/install.{sh,cfg} to installer/install.{sh,cfg}

Last edited by Trilby (2017-04-19 18:39:51)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#6 2017-04-19 19:04:16

IrvineHimself
Member
From: Scotland
Registered: 2016-08-21
Posts: 275

Re: [Solved] Help with a PCKGBUILD: mkdir: cannot create directory

Trilby wrote:

.....  But I'd just really be concerned with the quality of software coming from someone who botches the build system that badly.....

This is exactly what I am concerned about.

Trilby wrote:

.... I'm also not really sure what tripwire does.....

In my case, after I verified and white-listed the false positives of Rkhunter, I started  looking at what was disabled and skipped.

....
Checking for software intrusions                [ Skipped ]
Info: Check skipped - tripwire not installed
....

In view of the above, I thought, okay, it's in the AUR, why not install Tripwire. Basically, I was thinking that since  I have already ironed out the kinks of Rkhunter, and it is running the Tripwires checks, then Tripwire should require minimal configuration.

Trilby wrote:

*edit: actually this is what th current PKGBUILD in the AUR does.  If you do want to try tripwire, I bet using that as a starting point would make this pretty simple.

I have already had a looked at it, and was kind of lost. Trying to fix it was how I ended up at Git Hub.

So far, I have only really been writing very simple PCKGBUILDS, and this one was much more advanced. Having said that, I think I will go back to the AUR PCKGBUILD and see if I can figure out something that works.

Like I say, I understood exactly where your comments were coming from and realised they were directed at the upstream source.

When I get deeper into the Tripwire PCKGBUILD from the AUR, I may have more questions, but they will be different questions about a different PCKGBUILD.

Thanks for sharing your expertise

Irvine

Edit
Your second edit was made while I was writing this post. Thanks for that, I will make the required changes ASP. Unfortunately, for the moment I have real world concerns.
Irvine

Last edited by IrvineHimself (2017-04-19 19:07:31)


Et voilà, elle arrive. La pièce, le sous, peut-être qu'il arrive avec vous!

Offline

Board footer

Powered by FluxBB