Create FreeXL rpm for CentOS 7: spec file? - build

I'm trying to build a spec file to create rpm for FreeXL con CentOS 7.
If I try to execute these steps manually
tar xzf freexl-1.0.2.tar.gz
cd freexl-1.0.2
export MAKEFLAGS='-j2'
./configure --prefix=/usr/local && make && make install
all works fine I can see under /usr/local/..... the files aboout FreeXL.
I've tried to "translate" these steps in a spec file ... here you are it
#
# spec file for package freexl
#
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
%define libname lib%{name}1
Name: freexl
Version: 1.0.2
Release: 1.my
Summary: Library to extract valid data from within an Excel
License: MPL-1.1 or GPL-2.0+ or LGPL-2.1+
Group: Development/Libraries/C and C++
Url: https://www.gaia-gis.it/fossil/freexl/index
Source: http://www.gaia-gis.it/gaia-sins/%{name}-%{version}.tar.gz
BuildRequires: gcc-c++
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
FreeXL is an open source library to extract valid data from within an Excel (.xls) spreadsheet.
%package -n %{libname}
Summary: Shared library for FreeXL
Group: System/Libraries
%description -n %{libname}
FreeXL is an open source library to extract valid data from within an Excel (.xls) spreadsheet.
%package devel
Summary: Development files for %{name}
Group: Development/Libraries/C and C++
Requires: %{libname} = %{version}
Requires: glibc-devel
%description devel
This package contains all necessary include files and libraries needed
to compile and develop applications that use libspatialite.
#redefine path ...
%define _bindir /usr/local
%prep
%setup -q
%build
%configure
%install
./configure --prefix=%_bindir && make && make install
%changelog
I obtain my freexl-debuginfo-1.0.2-1.csi.x86_64.rpm file but when I try to install it nothing is installed (and no errors are shown during installation ....
I think that probably there are some errors in my spec file ...... any suggestions / examples?

I've solved: the problem was that my spec file was not complete ....
Here you're a correct spec file that works fine ....
https://build.opensuse.org/package/view_file/openSUSE:Factory/freexl/freexl.spec?expand=1
It works for CentOS 7 too!

Related

linking of C++ and Python with BOOST; error = rule "Copyright" unknown in module "xml"

I am trying to execute linking of C++ and Python with BOOST.
Using the example from https://www.boost.org/doc/libs/1_63_0/libs/python/doc/html/tutorial/tutorial/hello.html#tutorial.hello.let_s_jam, and issuing bjam at ~/libs/python/example/tutorial/ which contains these files:
hello.cpp hello.py Jamfile
The read-out from the console error is:
/home/benjamin/boost/boost_1_71_0/tools/build/src/tools/types/xml.jam:12:
in load ERROR: rule "Copyright" unknown in module "xml".
Here is what I undertook to solve this problem:
I built boost from boost_1_71_0.tar.bz2 using the ./b2 file in the directory /boost/boost_1_71_0/ which is dated November 14, 2019.
My Ubuntu 18.04 system has a b2 link at /usr/bin/b2 -> bjam, which is older (March 6, 2018) and the bjam file (March 6, 2018).
No other bjam files exist on the system.
From bjam for boost 1.54, I tried:
sudo-apt install bjam
error: E: Package 'bjam' has no installation candidate.
All the programs in the user-config.jam file (e.g., c++, msvc/code, python3) are correct, which is located in my /home/benjamin/boost/boost_1_71_0/tools/build/example/.
For pity's sake and to help me (newbie), please advise.
Looking at error message it seems that error is with file /home/benjamin/boost/boost_1_71_0/tools/build/src/tools/types/xml.jam
I checked with my local installation (which is boost 1.65.1), but I am not able to locate any file with name xml.jam. But I have few other .jam file at location /usr/share/boost-build/src/tools/types/. As example
asm.jam
# Copyright Craig Rodrigues 2005. Distributed under the Boost
# Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
type ASM : s S asm ;
So it seems that your xml.jam either invalid OR few lines should be commented (as in above file).
Try below options.
Check your xml.jam, if there are any content which are not related jam then you should comment out information.
Rename your xml.jam to xml.jam.bkp. This file may not be needed.(Not needed in my case with boost 1.65.1)
Try to install everything from Ubuntu package manager and use that. You can install all boost module by sudo apt install libboost-all-dev. I tried https://github.com/boostorg/python/tree/develop/example code with my local installed boost (1.65.1) from package manager and it work fine.

Apps cannot detect C++ poco even though I have installed it

I want to be able to make and run this particular library on my computer. Currently going through the INSTALL file. I am currently at the point:
After extracting the Poco (Complete Edition) source archive, the configure
script should be called with the following parameters:
./configure --omit=Crypto,Net,NetSSL_OpenSSL,Data/ODBC,Data/MySQL \
--no-tests --no-samples
This line avoids building the parts of Poco which are dependent on third-party
libraries, and are not required for openBliSSART.
You can also specify a prefix where Poco should be installed, but in most cases
you should leave the default /usr/local.
I can't seem to run the options, so I simply ran ./configure, this seemed to have worked till the point where I encountered:
checking for fftw_plan_dft_r2c_1d in -lfftw3... yes
checking for Poco (Enterprise)... no
configure: error: Need Poco Enterprise v1.3.6+!
But the fact is, that I have installed Poco already on the system through a brew install poco and downloaded the library from their source website and compiled it ground up. looking back at INSTALL:
Depending on where you have installed Poco, you may have to set the
LD_LIBRARY_PATH environment variable to contain the Poco "lib" directory,
or run the ldconfig tool. The following lines work with Ubuntu and openSUSE
($ indicates the shell prompt):
$ sudo sh -c 'echo <prefix>/lib > /etc/ld.so.conf.d/poco.conf'
$ sudo ldconfig
where <prefix> is the Poco install prefix (by default /usr/local).
Now when I do a simple sudo find / -name poco, I get:
/usr/local/var/homebrew/linked/poco
/usr/local/opt/poco
/usr/local/Cellar/poco
find: /private/var/db/ConfigurationProfiles/Store: Operation not permitted
find: /private/var/folders/pq/xchc5hxj02d754txf8nml5f00000gn/0/SafariFamily: Operation not permitted
find: /private/var/folders/pq/xchc5hxj02d754txf8nml5f00000gn/0/com.apple.LaunchServices.dv: Operation not permitted
find: /private/var/folders/pq/xchc5hxj02d754txf8nml5f00000gn/0/com.apple.nsurlsessiond: Operation not permitted
find: /private/var/folders/pq/xchc5hxj02d754txf8nml5f00000gn/0/com.apple.routined: Operation not permitted
find: /private/var/folders/zz/zyxvpxvq6csfxvn_n00000y800007k/0/com.apple.nsurlsessiond: Operation not permitted
find: /private/var/folders/zz/zyxvpxvq6csfxvn_n00000s4000069/0/com.apple.nsurlsessiond: Operation not permitted
find: /private/var/folders/zz/zyxvpxvq6csfxvn_n00000s4000069/0/com.apple.routined: Operation not permitted
/Users/sharanduggirala/Library/Logs/Homebrew/poco
/Users/sharanduggirala/Documents/of_v0.9.8_osx_release/libs/poco
/Users/sharanduggirala/Documents/of_v0.9.8_osx_release/scripts/apothecary/formulas/poco
find: /dev/fd/3: Not a directory
find: /dev/fd/4: Not a directory
Also, it looks like while building poco, I did a ./configure --static. Would this have affected my compilation? How do I link this library?
I have already used the command ./configure --with-poco-prefix=/usr/local/opt/poco which doesn't really change anything.
Notes relating to S.M.'s Answer
I tried this, but got the error:
brew install poco --with-static ⏎
==> Downloading https://pocoproject.org/releases/poco-1.9.0/poco-1.9.0-all.tar.gz
######################################################################## 100.0%
Error: SHA256 mismatch
Expected: 028de410fc78d5f9b1ff400e93ec3d59b9e55a0cbbf0d8fec04636882b72ea45
Actual: 0387bf0f9d313e2311742e1ad0b64e07f2f3e76039eed20e3b9aa9951b88e187
Archive: /Users/sharanduggirala/Library/Caches/Homebrew/poco-1.9.0.tar.gz
To retry an incomplete download, remove the file above.
I also tried:
./configure --static ⏎
configure: error: unrecognized option: `--static'
Try `./configure --help' for more information
Do not install poco from sources. Use brew install poco. If you want the same like ./configure --static use brew install poco --with-static.

not able to install anything using opam

I installed opam with homebrew on Mac OS X 10.10. But I can't install anything using opam. This is an example error output that get when I try to install ocamlfind:
# opam-version 1.2.0
# os darwin
# command ./configure -bindir /Users/roger/.opam/system/bin -sitelib /Users/roger/.opam/system/lib -mandir /Users/roger/.opam/system/man -config /Users/roger/.opam/system/lib/findlib.conf -no-topfind
# path /Users/roger/.opam/system/build/ocamlfind.1.5.5
# compiler system (4.02.1)
# exit-code 1
# env-file /Users/roger/.opam/system/build/ocamlfind.1.5.5/ocamlfind-91360-c61e7b.env
# stdout-file /Users/roger/.opam/system/build/ocamlfind.1.5.5/ocamlfind-91360-c61e7b.out
# stderr-file /Users/roger/.opam/system/build/ocamlfind.1.5.5/ocamlfind-91360-c61e7b.err
### stdout ###
# ...[truncated]
# Configuration for str written to site-lib-src/str/META
# Configuration for threads written to site-lib-src/threads/META
# Configuration for unix written to site-lib-src/unix/META
# Configuration for stdlib written to site-lib-src/stdlib/META
# Configuration for bigarray written to site-lib-src/bigarray/META
# Configuration for camlp4 written to site-lib-src/camlp4/META
# Configuration for ocamlbuild written to site-lib-src/ocamlbuild/META
# Configuration for compiler-libs written to site-lib-src/compiler-libs/META
# Configuration for bytes written to site-lib-src/bytes/META
# Detecting compiler arguments: FAILED (see the file ocargs.log for details)
### stderr ###
# ./configure: line 547: cd: src: No such file or directory
brew install opam
opam init --comp=4.02.1
eval `opam config env`
ocaml
Update:
Sometimes brewed opam can fail with Illegal Instruction, in that case you need to reinstall opam from sources:
brew reinstall --build-from-source opam
Also, you need a working toolchain, i.e., compiler, autotools and other developer tools. You can try to install it using brew, e.g., brew install autotools, etc. Or you can try to install xcode toolchain, including apple command line developer tools.
I had the same problem trying to install mirage, the problem is because the current directory is not in the CDPATH by default on macOS X. The posix /bin/sh will not "cd src" though can "cd ./src". The quick fix is to do the following before running opam (or just put it in your .bash_profile.
export CDPATH=.
opam install WHATEVER

building chromium latest release on android

I have to build latest release of chromium browser for android.
I am using the following step,
Create a Chromium root directory
mkdir chromium ; cd chromium
Download and export PATH of depot_tools
export PATH=$PATH:~/path/to/depot_tools/
Checked out the source for build 32.0.1665.2
gclient config https://src.chromium.org/chrome/releases/32.0.1665.2
4 The above command create a .gclient file in chromium root directory, and add the target android in .gclient.
target_os = ['android']
To download the initial code:
gclient sync
Install the Dependencies
6.1) cd /path/to/chromium/src
6.2) ./build/install-build-deps.sh
gclient runhooks call GYP to generate your platform-specific files. This should give you a complete source tree
gclient runhooks
Compile :
To build the ARM Android content shell:
1) cd /path/to/chromium/src
2) . build/android/envsetup.sh
3) android_gyp
4) ninja -C out/Release -j10 content_shell_apk
After following the above command i am getting the content_shell.apk which has version chrome/19.77.34.5, i am checking the version of chromium using the link http://whatsmyuseragent.com,
Please help me to build chromium latest version(32.0.1665.2) on android
Content shell does not display correct user agent version in android as well as linux (right now content_shell displays chrome/19.77.34.5).
This seems to be deliberate from src/content/content_shell.gypi
'variables': {
'content_shell_product_name': 'Content Shell',
# The "19" is so that sites that sniff for version think that this is
# something reasonably current; the "77.34.5" is a hint that this isn't a
# standard Chrome.
'content_shell_version': '**19.77.34.5**',
You can always use chromium_testshell which will give correct version (which is currently Chrome/35.0.1879.0).

rpmbuild change compression format

I try to pack some map files for our geoserver in an internal rpm package. For the build part, this is just to copy the files. I think this works as expected. But it takes terribly long to pack those 20GB of images.
I've read that rpm internally compresses the data and that this can be done with several different compression algorithms. But, I don't have a clue which compression my rpm chooses and how I can influence this. I could not find any options for the rpmbuild command, nor for the specfile nor for the general rpm options I can list with rpmbuild --showrc
I´m not very experienced with rpmbuild and specfiles, but after reading lots of man pages and tutorials on rpm.org I have no further ideas.
The specfile I use looks like:
%define debug_package %{nil}
%global mapsversion 0.9
# If this is a snapshot, put the date here and uncomment
#global snapshot_version 20100519
# This is the version in a form acceptable
# an an RPM version string (i.e. no '-')
# Hier werden die Makros definiert.
%global rpmversion %(echo %{mapsversion} | tr '-' '_')
%global pkgversion %{mapsversion}%{?snapshot_version:-SNAPSHOT}
%global pkgname %{name}
Name: geoserver-maps-part2
Version: %{rpmversion}
Release: 1%{?dist}
Summary: Swiss Maps for GeoServer
Group: Application/ourApp
License: Copyright (c) 2011
URL: http://doc.polyalert.local
#Source0: %{name}-%{version}.tgz
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires: geoserver
%define mapshome /opt/geoserver/swisstopo
%define mapssource /home/user/polyalert_env/geoserver/swisstopo
%description
Swiss Maps for GeoServer
%prep
%build
/bin/true
%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT%{mapshome}
cp -a %{mapssource}/pk100 $RPM_BUILD_ROOT%{mapshome}
%clean
rm -rf $RPM_BUILD_ROOT
%pre
%post
%preun
%files
%{mapshome}/pk100
%changelog
* Tue Feb 14 2012 user - 1.0
- First version of specfile
I call rpmbuild like this:
rpmbuild -bb --define "_topdir $TOP_DIR" --define "_gpg_name ourkey" --define "_signature gpg" --sign $TOP_DIR/SPECS/$SPEC_FILE_NAME $RPM_BUILD_PARAMETER
Any suggestions?
I was working with some RPM stuff today and accidentally stumbled upon the answer for ya!
Put these in your spec file:
%define _source_payload w0.gzdio
%define _binary_payload w0.gzdio
That will still use gzip but pass it -0 for a level, which should just store. On my RPM, it made it grow from 21MB to 76MB, so I'm pretty sure this is your answer!
BTW, I found that in one of the macro files - you can also do bzdio and any number from 0 to 9 to use bzip2. This was on RHEL4; later versions of RPM seem to support more compression options; but again, for what you want, the above should be what you need.
Please check the file /usr/lib/rpm/macros in your build machine, (the file maybe diff in path), it has a total support list of compression methods there: e.g.:
329 # Compression type and level for source/binary package payloads.
330 # "w9.gzdio" gzip level 9 (default).
331 # "w9.bzdio" bzip2 level 9.
332 # "w7.xzdio" xz level 7, xz's default.
333 # "w7.lzdio" lzma-alone level 7, lzma's default
334 #
335 #%_source_payload w9.gzdio
336 #%_binary_payload w9.gzdio
so here just as Aaron said, you can set it here for universal, or set specifically for your proj. spec.
I have used "%define _binary_payload w9.xzdio" on RHEL 6.6. As I understand, the default compression tool used in RHEL 6 is xz, but the default compression level appears to be 2, even though 7 is supposed to be xz's default. I kicked it up to 9 and some giant RPMs went from 653MB to 439MB. I was able to save a total of 1 gigabyte over the default compression.
I ran into the same issue with Ant building a runnable Jar RPM with Spring Boot Loader complaining of this:
Caused by: java.lang.IllegalStateException: Unable to open nested entry 'BOOT-INF/lib/accessors-smart-1.2.jar'. It has been compressed and nested jar files must be stored without compression. Please check the mechanism used to create your executable jar file
My ant build task was like this:
<exec executable="rpmbuild" failonerror="true">
<env key="version" value="${fullversion}" />
<arg value="-ba" />
<arg value="--clean" />
<arg value="${specfile}" />
</exec>
My solution to build an RPM with a runnable JAR was to disable the repacking, setting the macro definitions on the spec file did not do it for me.
Adding this to the spec file was what worked for me:
#Disable jar unpacking
%define __jar_repack 0
Reference:
https://bugzilla.redhat.com/show_bug.cgi?id=219731
Thanks to the previous posters for helping to focus in on the issue too.
Erion