Mailinglist Archive: opensuse (856 mails)

< Previous Next >
Re: [opensuse] Re: building smartmontools
On 2016-10-05 05:30, Andrei Borzenkov wrote:
04.10.2016 23:19, Carlos E. R. пишет:

It seems I may have to tune almost each single path, and that doesn't seem
correct to me. :-?


Actually you just need to additionally set --sysconfdir and may be
--libexecdir, everything else looks to default to correct path under
/usr. That is what build system does. "rpm --eval %configure" shows
configure invocation used by default when building packages. Or you can
look into smartmontools spec file to call configure exactly as package does.

Thanks both Andrei and Per :-)

Ah, the rpm source package, yes.


%configure\
--with-docdir=%{_defaultdocdir}/%{name}\
--with-selinux\
--with-systemdsystemunitdir=%{_unitdir}\
--enable-drivedb\
--enable-savestates\
--enable-attributelog

Mmmm.... It is using some macros, so what it does is not directly clear.


rpm --eval %configure smartmontools
yields the syntax help page. Ah, must be rpmbuild.

cer@AmonLanc:~/Compilaciones/hardware/smartmontools-6.5> rpmbuild --eval
%configure smartmontools

CFLAGS="${CFLAGS:--O2 -g -m32 -march=i586 -mtune=i686 -fmessage-length=0
-D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables
-fasynchronous-unwind-tables}" ; export CFLAGS ;
CXXFLAGS="${CXXFLAGS:--O2 -g -m32 -march=i586 -mtune=i686 -fmessage-length=0
-D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables
-fasynchronous-unwind-tables}" ; export CXXFLAGS ;
FFLAGS="${FFLAGS:--O2 -g -m32 -march=i586 -mtune=i686 -fmessage-length=0
-D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables
-fasynchronous-unwind-tables}" ; export FFLAGS ;
./configure --host=i586-suse-linux-gnu --build=i586-suse-linux-gnu \
--program-prefix= \
--disable-dependency-tracking \
--prefix=/usr \
--exec-prefix=/usr \
--bindir=/usr/bin \
--sbindir=/usr/sbin \
--sysconfdir=/etc \
--datadir=/usr/share \
--includedir=/usr/include \
--libdir=/usr/lib \
--libexecdir=/usr/lib \
--localstatedir=/var \
--sharedstatedir=/usr/com \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--disable-dependency-tracking
error: failed to stat
/home/cer/Compilaciones/hardware/smartmontools-6.5/smartmontools: No such file
or directory
cer@AmonLanc:~/Compilaciones/hardware/smartmontools-6.5>


AH!!! Very interesting. Although the package is not found. Well, I haven't
installed the source package. Doing now... similar result, except the final
error is:

error: failed to stat
/home/cer/Compilaciones/hardware/smartmontools-6.5/smartmontools: No such file
or directory

I'll ignore that.

Ok, trying:

./configure --program-prefix= --disable-dependency-tracking --prefix=/usr
--exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc
--datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib
--libexecdir=/usr/lib --localstatedir=/var --sharedstatedir=/usr/com
--mandir=/usr/share/man --infodir=/usr/share/info --disable-dependency-tracking


which produces:

-----------------------------------------------------------------------------
smartmontools-6.5 configuration:
host operating system: i686-pc-linux-gnu
C++ compiler: g++
C compiler: gcc
preprocessor flags:
C++ compiler flags: -g -O2 -Wall -W
C compiler flags: -g -O2
linker flags:
OS specific modules: os_linux.o cciss.o dev_areca.o
binary install path: /usr/sbin
man page install path: /usr/share/man
doc file install path: /usr/share/doc/smartmontools
examples install path: /usr/share/doc/smartmontools/examplescripts
drive database file: /usr/share/smartmontools/drivedb.h
database update script: /usr/sbin/update-smart-drivedb
download tools: curl wget lynx svn
local drive database: /etc/smart_drivedb.h
smartd config file: /etc/smartd.conf
smartd warning script: /etc/smartd_warning.sh
smartd plugin path: /etc/smartd_warning.d
smartd initd script: /etc/init.d/smartd.initd
smartd save files: [disabled]
smartd attribute logs: [disabled]
libcap-ng support: no
SELinux support: no
NVMe DEVICESCAN: no
-----------------------------------------------------------------------------

which builds for 686, preferable than 586. Even better, I'll use CFLAGS="-g -O2
--march=pentium4". CXXFLAGS doesn't accept "--march=pentium4", but that is not
important. Ah, single dash! Ok.

However, I see it will create "/etc/init.d/smartd.initd", and not the systemd
service file. I think I may need:

--with-systemdsystemunitdir=%{_unitdir}

but that one is not in the rpmbuild output. :-?

--
Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 "Bottle" at Telcontar)

< Previous Next >
Follow Ups