Debian packaging and version control - linux

I am building a Debian package from a source tarball. The initial debian directory is created with dh_make.
It creates a directory debian in the directory my tarball was extracted to. I then customize the content of the debian directory to fit my packaging needs. Then I build the package with dpkg-buildpackage -b.
My question is: What is the best (canonical?) way to put the contents of the customized debian directory in version control?
Do I just copy it out of the source directory, keep it in version control somewhere and every time I built, I extract the tarball and copy the directory back?

Related

Buildroot tools - adding a user libs from .RPM

I have some task to make linux's bootable image with my own package. This package (named starlet) is a set of .C modules + Makefile. I created the package/starlet directory and added Config.in and starlet.mk; selected in the Buildroot configuration to include my package to build target image.
So, it's works fine...
Now i'm need to build starlet's image with additional library from the zztop-dev package.
zztop-dev package is an .RPM package with set of .H and .C files to build target zztop.a (.so) libraries.
What do I need to do to install zztop-dev.RPM before building STARLET image?
Having the source code for a package stored in a .rpm file is quite uncommon. Buildroot has built-in rules to extract all the most common formats. Using an uncommon format requires you to write extraction rules on your own.
So the first question is whether you can use a more common format that Buildroot has rules for. You probably can access the source code from its original location in a source code repository (git, Subversion, whatever) or a tarball.
If you really need to extract the sources from am .rpm file, then you need to write your own custom extract commands. Look for LIBFOO_EXTRACT_CMDS in the Buildroot user manual.
But if your extract commands call the rpm command to do the extraction then you'll need the rpm tool either installed on your host machine, or packaged as a host package in Buildroot and listed as a dependency of zztop-dev. The former approach is way simpler, but it will force you to have rpm installed on every host machine where you run the build.

creating a .so file for linux/aio_abi.h

I am trying to build a Linux uImage and device tree for the zynq but my computer cant find the aio_abi.h file. I have moved the Linux folder which contains the file into the shared library folder that my system is looking but the file is still not being found. I think this is because there is no .so file for the folder containing the aio_abi file. I installed libaio-dev using the Ubuntu software installer tool because get-apt isn't working on my machine because of a proxy.
Is there a way to directly create a .so file for the folder I need to include or is there something wrong with the libaio-dev install? I have an older libaio1.so file but the older version doesn't contain the aio_abi file required.
Thanks

Files installed from debian package with dpkg do not belong to root

I created a binary package with this command:
dpkg-deb --build -z9 -Zlzma $(DEB_SRC_DIR) $(DEB_DEST_DIR)
and install it on my Ubuntu 12.04 with this command:
sudo dpkg -i /path/to/package
The contents of the package I think are irrelevant.
Despite the sudo command the files in the installation directory belong to the current user and not to root as I expected.
How can I fix that?
Try to run the dpkg-deb command with fakeroot:
`fakeroot dpkg-deb ...`
(This will only help if the files in the source directory already have the correct ownership, which they probably dont. The problem you're actually trying to solve here, is to create an archive with files in it that belong to user root, which is where fakeroot theoretically helps.)
Let me say though, that what you are doing is not the best way for creating a binary package (far from it).
Instead, create a debian/ directory with dh_make (from the dh-make package), and edit the control file and changelog accordingly. You also need a file debian/install that lists what files you are installing and where they should go. There are various guides on the net (and on Stack Overflow) that explain this process. For example, look at the Debian New Maintainers' Guide.
You can then use dpkg-buildpackage to create a real, standard-conforming Debian package with your files in a reproducible way.
dpkg-deb is a low-level tool for manipulating existing deb files; it's not meant to be used for package creation.

Standalone git binary on server with repository viewer

I have a server from my company.
On this server is git not installed (and it will not be in the near future).
(On many free server hosting sites, git is also not installed)
Is there a way to use a git binary without having git installed
(therefore without the needed dependencies in another folder, standalone)?
Another server is no option for me.
I want git for a web git repository viewer, which of course need the git binary working in any folder, maybe there is a web git repository viewer with integrated git binary.
I tried:
The server os is linux 64 Bit.
I have copied the git binary from local linux to the executable path on the server.
It did not work.
So I look up the dependencies. These libraries are needed:
libz.so.1
libresolv.so.2
libpthread.so.0
libpcre.so.3
libc.so.6
They are only links to libraries named:
libz.so.1.2.7
libresolv-2.17.so
libpthread-2.17.so
libpcre.so.3.13.1
libc-2.17.so
So I renamed the libraries and copied them to the server where the git binary lies. But unfortunately the git binary looks in the /lib/linux-64-gnu... os folder for the libraries, not in the same folder. I have no idea what to try next.
Here is my solution:
I downloaded and installed Ubuntu 13 on my Windows PC with the same architecture as the server I want to copy the standalone git binary. Architecture is x86_64 which stands for 64 bit. Download link is http://www.ubuntu.com/download/desktop
I burned it to a disk, booted from CD. Then I the username was 'Ubuntu', but I needed another one, so I installed Ubuntu on a USB-Stick 32GB.
I downloaded a git tarball file: 'git-1.7.3.tar.bz2' and extracted it with the command 'tar -jxvf git-1.7.3.tar.bz2' in Terminal after used the command 'cd ~/Downloads' to get to the directory, where the downloaded tarball git file is. Download link is code.google.com/p/kakola/downloads/detail?name=git-1.7.3.5.tar.bz2&can=2&q= (found it with googling 'git .tar.bz2')
Now there is a directory beside the .tar.bz2 file, go into it with 'cd git-1.7.3.5'
Just to make sure I installed every command mentioned from other websites that could be useful with 'sudo apt-get install libexpat1-dev asciidoc libz-dev gettext curl'
I created a directory at the path, where the bin should be on the server, because I only have home access it must be in the home folder, with 'mkdir /home/git'
Then I used the command './configure --prefix=/home/git/BIN CFLAGS="${CFLAGS} -static" NO_OPENSSL=1 NO_CURL=1' to fill the extracted folder with my config file: 'config.mak.autogen'
After that I made 'make' and then 'make doc' to create the files and then 'install' and 'make install-doc' and the directory I wanted the git binary filled up with all these files (pretty big 364MB on the stick)
Downloaded Gitlist and uploaded it to my server and uploaded the whole created Folder with all its binaries into the gitlist folder.
Changed the config.ini from Gitlist to use the standalone binary of git, instead of some PATH (also changed the projects path)
Gitlist finds the repository and shows it in the list view
(With GitWeb I got an error, but GitList seems OK)

steps needed to create binary package for distribution in linux

I am little confused on how to create a complete binary package using rpmbuild from a project I just created (already compiled binary).
my current project contain similar format as this user (Packaging proprietary software for Linux)
Where I have
foo (binary)
data
libs
foo.sh
libs will contain all the shared libraries the project requires, and foo.sh is a script that sets LD_LIBRARY_PATH to include libs. Therefore, the user will execute foo.sh and the program should start.
I am looking at the tutorial from this site (rpm tutorial)
I understand to create a rpm I create a build area use rpmdev-setuptree
I can create a spec file use cd ~/rpmbuild/SPECS; rpmdev-newspec foo and if I got a good SOURCES folder I can build it with rpmbuild -ba foo.spec
But I have no idea how to setup the SOURCES directory. The tutorial stated (here) that I should create a tarball and place all my source file in it and put in SOURCE directory. What would be the source file in my case?
You are trying to create a RPM from binary files you have already? In that case, you can just leave the whole building stuff out of the SPEC file, and you need a SOURCE directory to keep the bundles you've got, the %prep step described below will take them from here.
In a binary package I built a while back from zip files, I did:
Heading, with name, version, description written by me/cribbed from the originals
Sources: The original places to download the Linux packages, official documentation, ...
%prep: Just unpack the different pieces, delete some redundant files, ...
%build: Nothing to do
%install: Create the relevant directories under $RPM_BUILD_ROOT by hand, copy files there by install, copy/create configuration files, ...
%clean: Blow away $RPM_BUILD_ROOT
%files: An exhaustive list of all files installed.
This required a few iterations to get right. Afterwards I followed the upstream package by rebuilding my RPM (conveniently I had everything packaged up in a SRPM, where the Source part was kind of a misnomer...)

Resources