RPM Package on Centos 7

Issue #777 invalid
Former user created an issue

Hi m trying to build rpm package for piler 1.1.1

so I have installed rpm build with directory structure: BUILD BUILDROOT RPMS SOURCES SPECS SRPMS

cd /root/rpmbuild/SPECS I have piler.spec file from this link https://bitbucket.org/mivolz/piler/src/7d139629fb55634b5947c7bbe15dbfb8c8a8e506/redhat/piler.spec?at=master

In cd /root/rpmbuild/SOURCES I have downloaded piler-1.1.1.tar.gz

then in cd /root/rpmbuild/SPECS I am trying to build

rpmbuild -bb piler.spec

I have this error: RPM build errors: File not found: /root/rpmbuild/BUILDROOT/piler-1.1.1-1.x86_64/etc/init.d/rc.pilergetd

Comments (17)

  1. Janos SUTO repo owner

    If everytime when a bogus "major bug" is filed took away just a single day from my lifetime, then I'd be dead already.

    I think you know the problem: you copied the spec file from another project. No disrespect for Michael's fork, but that spec file is based on piler-0.1.25, a never released interim version, and you have piler-1.1.1 which doesn't have the pilergetd stuff any more.

  2. Former user Account Deleted

    sorry I have send you wrong link I am using your updated spec file for piler 1.1.1.

    %define name piler
    %define version 1.1.1
    %define release 1
    
    Summary:        an email archiving application
    Name:           %{name}
    Version:        %{version}
    Release:        %{release}
    License:        gpl
    Group:          Networking/Mail
    Source0:        %{name}-%{version}.tar.gz
    URL:            http://www.mailpiler.org/
    Buildroot:      /tmp/aa
    BuildRequires:  openssl-devel, tcp_wrappers-devel, poppler-utils, libzip-devel, catdoc, mysql-devel, tnef, unrtf, tre-devel
    Requires:       mysql, openssl, tcp_wrappers, libzip, poppler-utils, catdoc, tnef, unrtf, tre, httpd, php, php-mysql
    Provides:       libpiler.so()(64bit)
    
    %description
    piler is an email archiving application.
    
    %prep
    %setup
    
    %build
    ./configure --prefix=/usr --libdir=/usr/lib64 --sysconfdir=/etc --localstatedir=/var --enable-starttls --enable-tcpwrappers --with-database=mysql
    make clean all
    
    %install
    mkdir -p $RPM_BUILD_ROOT/etc/init.d
    make install DESTDIR=$RPM_BUILD_ROOT
    
    # Gotta also copy over a few other things
    mkdir -p $RPM_BUILD_ROOT/var/www
    cp -ar %{_topdir}/BUILD/%{name}-%{version}/webui $RPM_BUILD_ROOT/var/piler/www
    
    mkdir -p $RPM_BUILD_ROOT/usr/share/piler
    cp -r %{_topdir}/BUILD/%{name}-%{version}/contrib $RPM_BUILD_ROOT/usr/share/piler
    
    # Fix the base piler.conf file
    cp -f %{_topdir}/BUILD/%{name}-%{version}/etc/example.conf $RPM_BUILD_ROOT/etc/piler.conf.dist
    
    %files
    %defattr(-,root,root)
    %dir /var/piler
    %dir /var/piler/tmp
    %dir /var/piler/sphinx
    %dir /var/piler/store
    %dir /var/piler/stat
    %dir /var/run/piler
    %attr(6555,piler,piler) /usr/bin/pileraget
    %attr(6555,piler,piler) /usr/bin/pilerexport
    %attr(6555,piler,piler) /usr/bin/pilerget
    %attr(6555,piler,piler) /usr/bin/pilerpurge
    %attr(6555,piler,piler) /usr/bin/pilerimport
    %attr(6555,piler,piler) /usr/bin/reindex
    /etc/init.d/rc.piler
    /etc/init.d/rc.pilergetd
    /etc/init.d/rc.searchd
    %attr(0640,root,piler) /etc/piler.conf
    /etc/sphinx.conf.dist
    /usr/sbin/piler
    /usr/sbin/pilergetd
    /usr/sbin/pilerconf
    /usr/lib64/libpiler.a
    /usr/lib64/libpiler.so
    /usr/lib64/libpiler.so.0
    /usr/lib64/libpiler.so.0.1.1
    /usr/libexec/piler/daily-report.php
    /usr/libexec/piler/generate_stats.php
    /usr/libexec/piler/gmail-imap-import.php
    /usr/libexec/piler/indexer.delta.sh
    /usr/libexec/piler/indexer.main.sh
    /usr/libexec/piler/import.sh
    /usr/libexec/piler/postinstall.sh
    /usr/libexec/piler/purge.sh
    /usr/share/piler/db-mysql-root.sql.in
    /usr/share/piler/db-mysql.sql
    
    
    %pre
    groupadd piler
    useradd -g piler -s /bin/sh -d /var/piler piler
    usermod -L piler
    if [ -d /var/piler ]; then chmod 755 /var/piler; fi
    
    
    %post
    chown -R piler:piler /var/run/piler /var/piler
    echo /usr/lib > /etc/ld.so.conf.d/piler.conf
    ldconfig
    echo this is the postinstall stuff...
    echo run /usr/libexec/piler/postinstall.sh manually to configure piler
    
    %postun
    userdel piler
    groupdel piler
    
    
    %changelog
    * Tue Feb 24 2015 Janos Suto
      - 1.1.1 release of piler
    
    * Fri Nov  1 2013 Janos Suto
      - Fixed a bug causing issues when reading the retention|archiving_rules tables
    
    * Fri Oct 25 2013 Janos Suto
      - First release of the rpm package based on build 846
    
    #!rpm build
    
  3. Former user Account Deleted

    I just comment /etc/init.d/rc.pilergetd line in spec file. As you say I checked there is no pilergetd in piler-1.1.1 .

  4. Michael

    I am working on an up-to-date .spec file that should be at least useable for CentOS 7. However, this will take some time since I've been running into some trouble with the configure script and how it requires an existing piler user in the %build process.

    So I first need to figure out how to workaround this issue...

  5. Michael

    Ok, I can't remember anymore why I thought last time it would be a bigger issue to make a .spec file.

    Probably because it was few days before christmas and my head was already in holidays... lol

    I'am now having a working (i.e. buildable) .spec file done and now I need to test the build and may put some fine-tuning into it. Whatsoever, I am pretty confident that I can already show you guys a publishable .spec file soon ;)

  6. Former user Account Deleted

    hey Michael can u share ur spec file so that I can check where I am doing wrong?

  7. Michael

    You can find a first draft of my spec file and patches here: https://github.com/donmichelangelo/rpm-specs/tree/master/el7/piler

    • I recommend to use mock to build the .spec file

    • In case that you want to build piler for CentOS 6 you'll have to compile tre >= 0.8.0 yourself. Perhaps Janos could provide a buildfix to compile piler with tre 0.7.6 which can be found in base/EPEL repos of CentOS 6 which appears to be too old.

    • Since it is a draft the .spec file doesn't produce RPM files which I would call production-ready, at least not yet...

    However, compilation works and you can install the RPM file, although you'll probably have to setup the Sphinx and Webserver Config parts yourself.

    So basically, when you execute the postinstall.sh it could happen that not everything is being configured automatically and you have to rework some of the stuff yourself.

    I'am working on the latter part but couldn't find the time last week to finish this stuff ;)

  8. Janos SUTO repo owner

    tre 0.7.6 is obsolete, and NOT supported, sorry. Frankly, I'm not sure why anyone would pick centos 6 instead of the newer centos 7 using a fresh install. Which should be the case with piler.

  9. Michael

    Except the old tre version piler 1.2.0 compiles just fine on CentOS 6 and CentOS/RHEL 6 is still supported until November 2020.

    I've just included CentOS 6 compatilbity in the .spec file because there are also Sphinx RPMs for CentOS 6 available and because that C6 is still widely present in companies.

    However, my .spec won't compile on CentOS 6 unless you have newer versions of tre and tre-devel available to install.

    So, if you don't intend to support CentOS 6 I'll probably ditch the support again and leave it just as a hint in the spec file that piler "could" be built for CentOS 6.

  10. Log in to comment