I build my first rpm package. It is the prescriped way to deploy applications to our distributed SuSE Servers.
The application is build with NodeJs and Typescript.
We have a build step that transcribes the Typescript to Javascript into a dist folder. NPM provides the dependencies in a node_modules folder. Then there are some .env config files, a bash script to start the application called myApplication and a init.d script called myDaemon. These are all packed into a tar.gz file. The structure is the following:
myApplication.tar.gz
|
|--dist
| |
| |-index.js
| |-...
|
|--node_modules
| |
| |-dependency_a
| |-dependency_b
| |-...
|
|--.env
|--.env.production
|--.env.development
|--.env.sample
|--myApplication
|--myDaemon
The rpmbuild unpacks the tar.gz file, creates the needed folders in the build root and copies the files to the correct folders. dist and node_modules go the a folder in /opt. The configuration files to folder in /etc/, the daemon to /etc/init.d and the executable bash script to start the application to /usr/bin. The README is treated as documentation and the logfiles are marked as ghost.
This is the spec file:
%define debug_package %{nil}
# Use other payload algorithm to fix the following error on SuSE: Failed dependencies: rpmlib(FileDigests) <= 4.6.0-1 is needed
%define _binary_filedigest_algorithm 1
# automatically generate requires and provides from package.json
%{?nodejs_find_provides_and_requires}
# filter out any false provides created due to dependencies with native components
%{?nodejs_default_filter}
# name of zip file containing source without .zip extension
%define modname myApplication
Summary: The %{modname} is a nodeJs project
Name: %{modname}
Group: Applications/Server
Version: 0.1
Release: 1
License: None
URL: https://private.git/myApplication
Source0: myApplication.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: x86_64
ExclusiveArch: x86_64
BuildRequires: npm
Requires: nodejs10
AutoReq: no
AutoProv: no
%description
%{Summary}
#Unpack the tar.gz file
%prep
%setup -q -n myApplication
%build
#Code is already build
%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/etc/myApplication
%{__cp} -r $RPM_BUILD_DIR/myApplication/.env* $RPM_BUILD_ROOT/etc/myApplication
mkdir -p $RPM_BUILD_ROOT/opt/myApplication/dist
%{__cp} -r $RPM_BUILD_DIR/myApplication/dist $RPM_BUILD_ROOT/opt/myApplication/
mkdir -p $RPM_BUILD_ROOT/opt/myApplication/node_modules
%{__cp} -r $RPM_BUILD_DIR/myApplication/node_modules $RPM_BUILD_ROOT/opt/myApplication/
mkdir -p $RPM_BUILD_ROOT/usr/bin
%{__cp} -r $RPM_BUILD_DIR/myApplication/myApplication $RPM_BUILD_ROOT/usr/bin/myApplication
mkdir -p $RPM_BUILD_ROOT/etc/init.d/
%{__cp} -r $RPM_BUILD_DIR/myApplication/myDaemon $RPM_BUILD_ROOT/etc/init.d/myDaemon
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(0755, root, root)
%doc README.md
%dir /etc/myApplication
%config /etc/myApplication/.env
%config /etc/myApplication/.env.production
%config /etc/myApplication/.env.development
/etc/myApplication/.env.sample
/opt/myApplication
/usr/bin/myApplication
/etc/init.d/myDaemon
%ghost /var/log/myApplication.log
%ghost /var/log/myDaemon.log
%changelog
* Wed Sep 29 2021 seism0saurus
- Initial spec file for myApplication
The rpm build with -vv runs fine and lists all dependencies from node_modules. I can also open the rpm with a zip utility and can see all needed dependencies inside the /opt/myApplication/node_modules folder.
But only some of the dependencies in that node_modules folder are installed, when I run zypper install myApplication.rpm. For example dependency_b is missing but dependency_a was installed. I can check that with rpm -V -v --nodeps -p myApplication.rpm. The folders are marked as missing. Here is a part from the output:
.......T /opt/myApplication/node_modules/triple-beam/test.js
missing /opt/myApplication/node_modules/url-parse
missing /opt/myApplication/node_modules/url-parse/LICENSE
missing /opt/myApplication/node_modules/url-parse/README.md
missing /opt/myApplication/node_modules/url-parse/dist
missing /opt/myApplication/node_modules/url-parse/dist/url-parse.js
missing /opt/myApplication/node_modules/url-parse/dist/url-parse.min.js
missing /opt/myApplication/node_modules/url-parse/dist/url-parse.min.js.map
missing /opt/myApplication/node_modules/url-parse/index.js
missing /opt/myApplication/node_modules/url-parse/package.json
........ /opt/myApplication/node_modules/util-deprecate
I usually use Debian/GNU Linux and not SuSE, so I don't have any experience with rpm.
Can someone explain, why the folders and files are not installed, although rpm knows, that they should be installed and shows them as missing?
How can I fix that? Is something wrong with my spec or my approach to package a NodeJs application?
--- EDIT ---
The rpm package works fine inside my Leap 15 containers (rpm 4.14.3). The problems is only on a SLES 11 installation (rpm 4.4.2.3).
So the problems seems to be related with the old version of rpm.
--- EDIT 2 ---
I tweaked the spec by configuring the compression algorithm:
%define _source_payload w0.gzdio
%define _binary_payload w0.gzdio
Now i can install the package correctly with rpm but zypper has still the same problem.
Any thoughts on that?
Kind regards,
seism0saurus
The final solution was to use a different compression algorithm in the spec file and to give the package a new version number, so that zypper doesn't use the old version from cache.
%define _source_payload w0.gzdio
%define _binary_payload w0.gzdio
Related
I have built a package from https://github.com/fd00/yacp using cygport; however I just noticed that cygport [packagename.cygport] install command does NOT install in the cygwin filesystem, but in a subdirectory of the source build directory; as such, executables are not in the cygwin path, and you cannot call them by name.
I have seen:
http://cygwin.1069669.n5.nabble.com/Manual-installation-of-cygport-packages-td132812.html
So for most cases, it works just fine just to unpack the archive into the
root file system in order to test it.
https://cygwin-ports-general.narkive.com/RrfmRgr6/how-to-install-a-package-build-with-cygport
you could install yourself or by descending to the build directory and doing 'make
install' or simply run it from the build directory :-)
So, now I have packagename.tar.xz and packaganame.hint - can't I use these with the Cygwin setup-x86_64.exe program (so that I'd have a marked entry, when I look up the package name in setup)?
If I "install" by just unpacking packagename.tar.xz into the Cygwin root filesystem, how do I "uninstall" then?
Does cygport change installation paths in respect to make install of the package? If not, then I guess make install is an option, because then I should have make uninstall too ...
cygport is the tool to build packages that can be installed with Cygwin setup-$ARCH.exe installation.
You can create a local setup structure, and use the calm package to create
the needed setup.ini file.
$ cygcheck -f /usr/bin/mksetupini
calm-20200220-1
Create a website directory similar to the cache you have from downloading, make a ARCH/release directory and copy the content of dist for the packages you are interested.
I am using a script like this to prepare the directory for setup
#!/bin/bash
cd /pub/altervista/
rm x86/setup.ini x86_64/setup.ini
for i in x86 x86_64
do
mksetupini --arch ${i} --inifile=${i}/setup.ini --releasearea=. --disable-check=missing-required-package,missing-depended-package
bzip2 <${i}/setup.ini >${i}/setup.bz2
xz -6e <${i}/setup.ini >${i}/setup.xz
done
In this moment its structure is like this:
$ cd http%3a%2f%2fmatzeri.altervista.org%2f
$ find x86_64/ -type f
x86_64/release/perl-Cairo/perl-Cairo-1.107-1-src.tar.xz
x86_64/release/perl-Cairo/perl-Cairo-1.107-1.hint
x86_64/release/perl-Cairo/perl-Cairo-1.107-1.tar.xz
x86_64/release/perl-Cairo/perl-Cairo-debuginfo/perl-Cairo-debuginfo-1.107-1.hint
x86_64/release/perl-Cairo/perl-Cairo-debuginfo/perl-Cairo-debuginfo-1.107-1.tar.xz
x86_64/release/perl-Glib/perl-Glib-1.3292-1-src.tar.xz
x86_64/release/perl-Glib/perl-Glib-1.3292-1.hint
x86_64/release/perl-Glib/perl-Glib-1.3292-1.tar.xz
x86_64/release/perl-Glib/perl-Glib-debuginfo
x86_64/release/perl-Glib/perl-Glib-debuginfo/perl-Glib-debuginfo-1.3292-1.hint
x86_64/release/perl-Glib/perl-Glib-debuginfo/perl-Glib-debuginfo-1.3292-1.tar.xz
x86_64/setup.bz2
x86_64/setup.ini
x86_64/setup.xz
than you can just install from that Website local directory. A fake Website works fine.
Ok, found and followed the instructions here: https://cygwin.com/package-server.html
First install calm via Cygwin's setup.exe (for me, setup-x86_64.exe):
Install calm 20200220-1
Install python36-setuptools 41.2.0-1 (automatically added)
Then, I have:
$ which mksetupini
/usr/bin/mksetupini
Note, I have already: /cygdrive/d/Downloads/cygwin_packages/http%3a%2f%2fcygwin.mirror.constant.com%2f/x86_64 where Cygwin stores downloaded packages; that directory has release subdir and setup.ini file.
So, now I can create a directory for my custom packages:
$ mkdir /cygdrive/d/Downloads/cygwin_packages/cygwin-custom
$ mkdir -p /cygdrive/d/Downloads/cygwin_packages/cygwin-custom/x86_64/release
Note that in my source build folder, I have a dist subfolder, which contains the packaging:
$ ls -la [packagename]-[version]-1bl1.x86_64/dist/[packagename]/
total 2557
drwxr-xr-x 1 user None 0 Mar 21 18:26 .
drwxr-xr-x 1 user None 0 Mar 21 18:26 ..
-rw-r--r-- 1 user None 373 Mar 21 18:26 [packagename]-[version]-1bl1.hint
-rw-r--r-- 1 user None 177772 Mar 21 18:26 [packagename]-[version]-1bl1.tar.xz
-rw-r--r-- 1 user None 2430900 Mar 21 18:26 [packagename]-[version]-1bl1-src.tar.xz
drwxr-xr-x 1 user None 0 Mar 21 18:26 [packagename]-debuginfo
drwxr-xr-x 1 user None 0 Mar 21 18:26 lib[packagename]0
drwxr-xr-x 1 user None 0 Mar 21 18:26 lib[packagename]-devel
I can just copy this to the arch/release child dir of cygwin-custom, and then change directory to cygwin-custom:
$ cp -a [packagename]-[version]-1bl1.x86_64/dist/[packagename] /cygdrive/d/Downloads/cygwin_packages/cygwin-custom/x86_64/release/
$ pushd /cygdrive/d/Downloads/cygwin_packages/cygwin-custom
Now, note that if I just call mksetupini as in the above webpage, it will fail:
$ mksetupini --arch x86_64 --inifile=x86_64/setup.ini --releasearea=.
mksetupini: package '[packagename]' version '[version]-1bl1' requires nonexistent or errored package 'cygwin'
mksetupini: package '[packagename]' version '[version]-1bl1' requires nonexistent or errored package 'libgcc1'
mksetupini: package '[packagename]' version '[version]-1bl1' requires nonexistent or errored package 'libreadline7'
...
... and the file setup.ini does not get created!
Then I thought I should symlink as in the above webpage:
$ for ARCH in x86_64 noarch ; do
mkdir -p ${ARCH}/release
cd ${ARCH}/release
ln -s /cygdrive/d/Downloads/cygwin_packages/http%3a%2f%2fcygwin.mirror.constant.com%2f/${ARCH}/release/* .
cd ../..
done
$ mksetupini --arch x86_64 --inifile=x86_64/setup.ini --releasearea=.
mksetupini: no .hint files in ./noarch/release/adwaita-icon-theme but has files: adwaita-icon-theme-3.26.1-1.tar.xz
mksetupini: no .hint files in ./noarch/release/base-cygwin but has files: base-cygwin-3.8-1.tar.xz
mksetupini: no .hint files in ./noarch/release/base-files but has files: base-files-4.3-2.tar.xz
...
mksetupini: package '[packagename]' version '[version]-1bl1' requires nonexistent or errored package 'cygwin'
mksetupini: package '[packagename]' version '[version]-1bl1' requires nonexistent or errored package 'libgcc1'
mksetupini: package '[packagename]' version '[version]-1bl1' requires nonexistent or errored package 'libreadline7'
mksetupini: package '[packagename]' version '[version]-1bl1' depends nonexistent or errored package 'cygwin'
...
... and this does not create setup.ini either.
Finally I found https://github.com/cascent/neovim-cygwin/issues/7 that mentioned the switch --okmissing required-package - so, finally this command:
$ mksetupini --arch x86_64 --inifile=x86_64/setup.ini --releasearea=. --okmissing required-package
... will finally create setup.ini - which will only contain our custom built packages, as they are the only ones that have a .hint file ( I don't have any .hint files in the http%3a%2f%2fcygwin.mirror.constant.com%2f directory, where cygwin usually downloads packages ):
$ cat x86_64/setup.ini
# This file was automatically generated at 2020-03-21 19:42:00 CET.
#
# If you edit it, your edits will be discarded next time the file is
# generated.
#
# See https://sourceware.org/cygwin-apps/setup.ini.html for a description
# of the format.
release: cygwin
arch: x86_64
setup-timestamp: 1584816120
# [packagename]
sdesc: "Blah blah ..."
...
Now, start Cygwin setup.exe, and when the choice screen is: "Cygwin Setup - Choose Installation Type"; here switch from "Install from Internet (...)" to "Install from Local Directory"; on Next > keep Root directory the same; on Next > Select Local Package Directory: I chose D:\Downloads\cygwin_packages\cygwin-custom - on Next > : Select Packages: View Full, then [packagename] is listed there ... and can be installed - and dependencies are resolved, too:
Install [packagename] [version]-1bl1
Install lib[packagename]0 [version]-1bl1 (automatically added)
And finally, after installation, I can call [packagename].exe by name directly in the Cygwin bash shell!
Not too bad of a process, but can get a bit involved if you cannot find the right documentation ...
My team is delivering a product that requires some perl modules, and since we deliver a full OS installer (Ubuntu 12.04) we want those modules as .deb packages. I've been able to build some other perl (like Algorithm::LUHN, Env::C, Linux::PID and Config::Properties) by following the instructions here, but having problems with Apache2::SizeLimit
Tried with Apache-SizeLimit-0.96 and Apache-SizeLimit-0.97... and all the methods described in the doc. Also tried in different OSs versions; Ubuntu 14.04.2, Ubuntu 12.04.5 (clean install), all the attempts ended with the same error:
test#test:~$ dh-make-perl --build --cpan Apache::SizeLimit
Going to read '/home/test/.cpan/Metadata'
Database was generated on Thu, 19 Mar 2015 02:17:02 GMT
CPAN: Digest::SHA loaded ok (v5.61)
Checksum for /home/test/.cpan/sources/authors/id/P/PH/PHRED/Apache-SizeLimit-0.97.tar.gz ok
Apache-SizeLimit-0.97/
Apache-SizeLimit-0.97/Changes
Apache-SizeLimit-0.97/INSTALL
Apache-SizeLimit-0.97/lib/
Apache-SizeLimit-0.97/LICENSE
Apache-SizeLimit-0.97/Makefile.PL
Apache-SizeLimit-0.97/MANIFEST
Apache-SizeLimit-0.97/MANIFEST.SKIP
Apache-SizeLimit-0.97/META.json
Apache-SizeLimit-0.97/META.yml
Apache-SizeLimit-0.97/README
Apache-SizeLimit-0.97/t/
Apache-SizeLimit-0.97/t/apache/
Apache-SizeLimit-0.97/t/apache2/
Apache-SizeLimit-0.97/t/pod.t
Apache-SizeLimit-0.97/t/response/
Apache-SizeLimit-0.97/t/response/TestApache/
Apache-SizeLimit-0.97/t/response/TestApache2/
Apache-SizeLimit-0.97/t/response/TestApache2/basic.pm
Apache-SizeLimit-0.97/t/response/TestApache2/check_n_requests2.pm
Apache-SizeLimit-0.97/t/response/TestApache2/deprecated.pm
Apache-SizeLimit-0.97/t/response/TestApache2/zzz_check_n_requests.pm
Apache-SizeLimit-0.97/t/response/TestApache/basic.pm
Apache-SizeLimit-0.97/t/response/TestApache/check_n_requests2.pm
Apache-SizeLimit-0.97/t/response/TestApache/deprecated.pm
Apache-SizeLimit-0.97/t/response/TestApache/zzz_check_n_requests.pm
Apache-SizeLimit-0.97/t/apache2/all.t
Apache-SizeLimit-0.97/t/apache/all.t
Apache-SizeLimit-0.97/lib/Apache/
Apache-SizeLimit-0.97/lib/Apache2/
Apache-SizeLimit-0.97/lib/Apache2/SizeLimit.pm
Apache-SizeLimit-0.97/lib/Apache/SizeLimit/
Apache-SizeLimit-0.97/lib/Apache/SizeLimit.pm
Apache-SizeLimit-0.97/lib/Apache/SizeLimit/Core.pm
CPAN: File::Temp loaded ok (v0.22)
======================================================================
Unpacked tarball already existed, directory renamed to /home/test/Apache-SizeLimit-0.97.13910
======================================================================
Using META.json
Found: Apache2-SizeLimit 0.97 (libapache2-sizelimit-perl arch=all)
cat: /etc/mailname: No such file or directory
No APT contents can be loaded.
Please install 'apt-file' package (at least version 2.5.0) and
run 'apt-file update' as root.
Dependencies not updated.
Using maintainer: test
Found docs: README
cat: /etc/mailname: No such file or directory
Using rules: /usr/share/dh-make-perl/rules.dh7.tiny
cat: /etc/mailname: No such file or directory
make: Entering directory `/home/test/Apache-SizeLimit-0.97'
dh clean
dh_testdir
dh_auto_clean
dh_clean
make: Leaving directory `/home/test/Apache-SizeLimit-0.97'
make: Entering directory `/home/test/Apache-SizeLimit-0.97'
dh build
dh_testdir
dh_auto_configure
Can't find mod_perl installed
The error was: Can't locate mod_perl2.pm in #INC (#INC contains: /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at Makefile.PL line 147.
dh_auto_configure: perl Makefile.PL INSTALLDIRS=vendor returned exit code 2
make: *** [build] Error 2
make: Leaving directory `/home/test/Apache-SizeLimit-0.97'
Cannot create deb package: 'debian/rules build' failed.
Will appreciate any help on fixing it
Sharing how it was solved. As #grant-mclean answered; I was missing a -dev package: the "apache2-dev" (apache2-threaded-dev).
With it, and skipping tests I was able to build the .deb package.
sudo apt-get install devscripts dh-make-perl libapache2-mod-perl2 libapache2-mod-perl2-dev apache2-threaded-dev
export DEB_BUILD_OPTIONS="$DEB_BUILD_OPTIONS nocheck"
dh-make-perl --build --cpan Apache::SizeLimit
Usually when you're trying to build something on Debian and get a message about something being missing, you need to install a 'dev' package - one that contains things like header files that aren't needed by the runtime.
I'm just guessing, but in your case perhaps you need to install: libapache2-mod-perl2-dev
I'm trying to cross-compile GStreamer. Version is 1.2.3. Host PC's OS is x86 linux and Target system's OS is MIPSEL linux OS.
I succeeded to compile gstreamer and plugins for target device. And gst-launch-1.0 could be executed. So I tried to use basic plugin, libgstvideotestsrc. But it didn't work. So I ran ```gst-inspect-1.0' to inspect plugins then I found the result like below.
# gst-inspect-1.0 -b
Blacklisted files:
libgstinterlace.so
libgstfbdevsink.so
libgstgeometrictransform.so
libgstmultifile.so
libgstencodebin.so
libgstfestival.so
libgstlevel.so
libgstdvdspu.so
libgstauparse.so
libgsty4menc.so
libgstvideofilter.so
libgstvideoscale.so
libgstaccurip.so
libgstvideoconvert.so
libgstaudioparsers.so
libgsttcp.so
libgstvolume.so
libgstcoreelements.so
libgstmpegtsdemux.so
libgstid3tag.so
libgstadpcmdec.so
libgstmfc.so
libgstrtpmanager.so
libgstaudiotestsrc.so
libgstdeinterlace.so
libgstdebug.so
libgstplayback.so
libgstspeed.so
libgstasfmux.so
libgsticydemux.so
libgstmpegpsdemux.so
libgstalaw.so
libgstwavparse.so
libgstpnm.so
libgstnavigationtest.so
libgstcamerabin2.so
libgstsdpelem.so
libgstisomp4.so
libgstliveadder.so
libgstmpegtsmux.so
libgstautodetect.so
libgstmultipart.so
libgstvideofiltersbad.so
libgstaudioresample.so
libgstautoconvert.so
libgstdvbsuboverlay.so
libgstid3demux.so
libgstvideobox.so
libgstgio.so
libgstdtmf.so
libgstremovesilence.so
libgstreplaygain.so
libgstaudioconvert.so
libgstcutter.so
libgstgaudieffects.so
libgstdvb.so
libgstaudiovisualizers.so
libgstudp.so
libgstimagefreeze.so
libgstadder.so
libgstpcapparse.so
libgstmxf.so
libgstshapewipe.so
libgstgdp.so
libgstwavenc.so
libgstshm.so
libgstflv.so
libgstfreeverb.so
libgstoss4audio.so
libgstsubenc.so
libgstaudiorate.so
libgstinter.so
libgsttypefindfunctions.so
libgstvideorate.so
libgstrtp.so
libgstcoloreffects.so
libgstmpegpsmux.so
libgstivtc.so
libgstjpegformat.so
libgstsmpte.so
libgstalphacolor.so
libgstsubparse.so
libgstaudiofxbad.so
libgstvideomixer.so
libgstmulaw.so
libgstdebugutilsbad.so
libgsteffectv.so
libgstfieldanalysis.so
libgstadpcmenc.so
libgstrawparse.so
libgstavi.so
libgstdataurisrc.so
libgstapetag.so
libgstinterleave.so
libgstmidi.so
libgstrtsp.so
libgstapp.so
libgstalpha.so
libgstaudiofx.so
libgstvideocrop.so
libgstvideotestsrc.so
libgstspectrum.so
libgstbayer.so
libgstaiff.so
libgstsegmentclip.so
libgstfrei0r.so
Total count: 106 blacklisted files
I wonder the meaning of 'blacklisted' and how I should approach this problem. Please let me know if you need several information to resolve this issue.
Here is my build configuration for GStreamer.
#PACKAGES: Name + version
export GST_PLUGIN_BASE="gst-plugins-base-1.2.3"
export GST_PLUGIN_GOOD="gst-plugins-good-1.2.3"
export GST_PLUGIN_BAD="gst-plugins-bad-1.2.3"
#HOST & Build configuration.
export HOST="mips-linux-gnu"
export BUILD="i686-pc-linux-gnu"
#Set path for file system.
export BUILD_PATH="~~~~~"
export ROOTFS_PATH="${BUILD_PATH}/rootfs"
export MIPS_LIB="~~~"
export INSTALL_PATH="${ROOTFS_PATH}/usr"
export INSTALL_PATH_LIB="${ROOTFS_PATH}/usr/lib"
#Compiler options
export PATH="${PATH}:${INSTALL_PATH}/bin"
export CFLAGS="-I${ROOTFS_PATH}/usr/include -I${ROOTFS_PATH}/usr/include/glib-2.0 -I${ROOTFS_PATH}/usr/lib/glib-2.0/include -I${ROOTFS_PATH}/usr/include/gstreamer-1.0 -I${ROOTFS_PATH}/usr/include/gio-unix-2.0 -mno-compact-eh -EL"
export CPPFLAGS="-I${ROOTFS_PATH}/usr/include -I${ROOTFS_PATH}/usr/include/glib-2.0 -I${ROOTFS_PATH}/usr/lib/glib-2.0/include -I${ROOTFS_PATH}/usr/include/gstreamer-1.0 -I${ROOTFS_PATH}/usr/include/gio-unix-2.0 -mno-compact-eh -EL"
export CXXFLAGS=$CPPFLAGS
export GST_CHECK_CFLAGS="-I${ROOTFS_PATH}/usr/include -I${ROOTFS_PATH}/usr/include/glib-2.0/include"
export PKG_CONFIG="/usr/bin/pkg-config"
export PKG_CONFIG_PATH="${PATH}:${ROOTFS_PATH}/lib/pkgconfig/:${ROOTFS_PATH}/usr/lib/pkgconfig/:${ROOTFS_PATH}/usr/local/lib/pkgconfig/:/usr/lib/pkgconfig:/usr/local/lib/pkgconfig:/lib/pkgconfig"
export LD_LIBRARY_PATH="/lib:/usr/local/lib"
export CC="~~~mips-linux-gnu-gcc -EL"
export CXX="~~~mips-linux-gnu-g++ -EL"
cd ${BUILD_PATH}
#GStreamer 1.2.3
#http://greenday96.egloos.com/viewer/4627046
wget http://gstreamer.freedesktop.org/src/gstreamer/$GSTREAMER.tar.xz
tar xf $GSTREAMER.tar.xz
cd $GSTREAMER
./configure --prefix=$INSTALL_PATH --build=$BUILD --host=$HOST --disable-nls --disable-static
sudo make
sudo make install
cd ..
#gst-plugin-base 1.2.3
wget http://gstreamer.freedesktop.org/src/gst-plugins-base/$GST_PLUGIN_BASE.tar.xz
tar xf $GST_PLUGIN_BASE.tar.xz
cd $GST_PLUGIN_BASE
./configure --prefix=$INSTALL_PATH --build=$BUILD --host=$HOST --disable-nls --disable-static --disable-examples --disable-pango
sudo make
sudo make install
cd ..
# gst-plugin-good-1.2.3
# http://gstreamer.freedesktop.org/src/gst-plugins-good/gst-plugins-good-1.2.3.tar.xz
wget http://gstreamer.freedesktop.org/src/gst-plugins-good/$GST_PLUGIN_GOOD.tar.xz
tar xf $GST_PLUGIN_GOOD.tar.xz
cd $GST_PLUGIN_GOOD
./configure --prefix=$INSTALL_PATH --build=$BUILD --host=$HOST --disable-nls --disable-static --disable-valgrind --disable-equalizer --disable-flx --disable-goom --disable-goom2k1 --disable-matroska --disable-monoscope --disable-oss --disable-cairo --disable-gdk_pixbuf --disable-soup --disable-libpng --disable-gst_v4l2
sudo make
sudo make install
cd ..
# gst-plugin-bad-1.2.3
# http://gstreamer.freedesktop.org/src/gst-plugins-bad/gst-plugins-bad-1.2.3.tar.xz
wget http://gstreamer.freedesktop.org/src/gst-plugins-bad/$GST_PLUGIN_BAD.tar.xz
tar xf $GST_PLUGIN_BAD.tar.xz
cd $GST_PLUGIN_BAD
./configure --prefix=$INSTALL_PATH --build=$BUILD --host=$HOST --disable-nls --disable-static --disable-y4m --disable-siren --disable-librfb --disable-yadif --disable-smooth --disable-videoparsers --disable-decklink --disable-valgrind --disable-directfb --disable-examples
sudo make
sudo make install
cd ..
if you want to know for sure why these plugins are blacklisted, you can remove "registry.dat" (run locate to find out its location), then rerun gst-inspect , the plugins will be examined once again and the reason for blacklisting them should be printed.
There can be several reasons why they are blacklisted, if you do this you should find them out.
Alternatively, you can also run gst-inspect location_of_the_dynamic_library.so
For gstreamer 1.8 gst-inspect-1.0 need to be launcged with additional GST_DEBUG=4 env var to view detailed reason (incompatible version in my case):
GST_DEBUG=4 gst-inspect-1.0 /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgst_some_plugin.so
...15-20 lines with non-interesting details...
0:00:00.035553207 4287 0x29f93c00 WARN GST_PLUGIN_LOADING gstplugin.c:485:gst_plugin_register_func: plugin "/usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgst_some_plugin.so" has incompatible version (plugin: 1.10, gst: 1,8), not loading
Could not load plugin file: File "/usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgst_some_plugin.so" appears to be a GStreamer plugin, but it failed to initialize
In my case it was blacklisted as I have built kvssink which have dependencies on other libraries. And GStreamer doesn't found them.
It was like that:
gst-inspect-1.0 kvssink
(gst-plugin-scanner:22): GStreamer-WARNING **: 13:07:28.097: Failed to load plugin '/root/bin/producer/libgstkvssink.so': libproducer.so: cannot open shared object file: No such file or directory
(gst-plugin-scanner:22): GStreamer-WARNING **: 13:07:28.204: Failed to load plugin '/root/bin/producer/libproducer.so': libcproducer.so: cannot open shared object file: No such file or directory
To confirm libraries issue I've used ldd
ldd libgstkvssink.so
Which will list all dependencies with paths were they may be found in system.
my libraries libcproducer.so and libcproducer.so were not found.
Based on path pritned for other visible libraries
linux-vdso.so.1 (0x00007ffc3c1a6000)
libgstreamer-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0 (0x00007f064d24d000)
I just copied missing libraries to /usr/lib/x86_64-linux-gnu/
In my case it was:
cp libcproducer.so /usr/lib/x86_64-linux-gnu/
cp libproducer.so /usr/lib/x86_64-linux-gnu/
And than:
gst-inspect-1.0 kvssink
prints plugin details.
I've resolved that thanks to information in this thread:
Linking against external libraries in gstreamer plugin using autotools
I found the reason. It's GLIB, not GStreamer.
To build GLIB for mipsel, I should set glib_cv_uscore=no. It's up to your embedded device. So please check your target hardware's CPU specification. So I made the build script for GLIB like below.
#Glib 2.42.1
wget ftp://ftp.gnome.org/pub/gnome/sources/glib/2.42/$GLIB.tar.xz
tar xf $GLIB.tar.xz
cd $GLIB
#Build for MIPS
echo "ac_cv_func_posix_getgrgid_r=yes" > mips.cache
echo "ac_cv_func_posix_getpwuid_r=yes" >> mips.cache
echo "glib_cv_stack_grows=no" >> mips.cache
echo "glib_cv_uscore=no" >>mips.cache
./configure --prefix=$INSTALL_PATH --host=$HOST --cache-file=mips.cache --build=$BUILD
make
make install
cd ..
I got the clue from here.
I'm creating my own RPM using rpmbuild.
My RPM contains config files which should never get overridden, even if the RPM contains a new version of these config files.
To archive this, I tagged these with
%config(noreplace) /opt/mypackage/etc/*
in the spec file.
According to the documentation and this site, a locally modified file will never get overridden in this case which is exactly what I want.
However, when doing the following operations:
Install version 1 of the RPM
Change configuration file etc/myconfig
Update package with version 2 of the RPM
I'm getting a conflict:
$ rpm --prefix ~/rpmroot/ -ih dist/mypackage-1.0.1-1.x86_64.rpm
########################################### [100%]
file /home/user/rpmroot/mypackage/etc/myconfig from install of mypackage-1.0.2-1.x86_64 conflicts with file from package mypackage-1.0.1-1.x86_64
Questions:
How can this conflict be explained? (I'd expect that the new version of the config file would be stored as myconfig.rpmnew and the existing remains untouched)
What I am doing wrong?
UPDATE (additional information)
The output of rpm -qcp dist/mypackage-1.0.1-1.x86_64.rpm is:
/opt/mypackage/etc/config1.xml
/opt/mypackage/etc/config2.xml
/opt/mypackage/etc/run.sh
/opt/mypackage/etc/config3.xml
The complete %files section:
%files
%defattr(0444,root,root)
/opt/mypackage/java/*
#dba
%defattr(0444,root,root)
/opt/mypackage/dba/sql/*
%defattr(0555,root,root)
/opt/mypackage/dba/script/*
#srv
%defattr(0555,root,root)
/opt/mypackage/srv/bin/*
/opt/mypackage/srv/lib/*
#etc
%defattr(0664,root,root)
%config(noreplace) /opt/mypackage/etc/*
If this is actually your issue, you may kick yourself ...
I think this may be just because you are "installing" and not "upgrading"
replace -ih with -Uh
I created a test RPM with similar setup, here are the results:
With -ih as you did
$ sudo rpm --prefix ~/rpmroot/ -ih
/home/nhed/rpmbuild/RPMS/x86_64/ptst-1.1.0-1.x86_64.rpm
##################################### [100%] file /home/nhed/rpmroot/etc/a from install of ptst-1.1.0-1.x86_64 conflicts
with file from package ptst-1.0.0-1.x86_64 file
/home/nhed/rpmroot/etc/b from install of ptst-1.1.0-1.x86_64 conflicts
with file from package ptst-1.0.0-1.x86_64 file
/home/nhed/rpmroot/etc/c from install of ptst-1.1.0-1.x86_64 conflicts
with file from package ptst-1.0.0-1.x86_64
With -Uh
$ sudo rpm --prefix ~/rpmroot/ -Uh
/home/nhed/rpmbuild/RPMS/x86_64/ptst-1.1.0-1.x86_64.rpm
##################################### [100%]
warning: /home/nhed/rpmroot/etc/a created as /home/nhed/rpmroot/etc/a.rpmnew
##################################### [100%]
please advice why I get the error "Bad file: /root/rpmbuild/SOURCES/test.sh"
I need to create rpm file ,
I only have the spec file under SPECS
and the test.sh script under SOURCES
what’s wrong here?
[root#linux /usr/src/redhat]# ls
BUILD RPMS SOURCES SPECS SRPMS
the spec file:
Summary: An example tool. To show a simple rpm build of the tool.
Name: test.sh
Version: 6.2
Release: 2
Source:/root/test.sh
Group: Development/Debuggers
BuildRoot:/var/tmp/test.sh
%description
Bad file: /root/rpmbuild/SOURCES/test.sh: No such file or directory RPM build errors: Bad file: /root/rpmbuild/SOURCES/test.sh: No such file or directory
The path to sources is never used; all source files must be in %{_sourcedir}, with the same name as the last component of the path.