(Re)Building Packages Generally and Dosemu specifically

Need help with C, C++, perl, python, etc?

(Re)Building Packages Generally and Dosemu specifically

Postby k829king » 2018-08-26 10:05

I'm trying to rebuild the dosemu package on stretch.

Q1. I have found two references to follow, any guidance on whether one is more appropriate or not?
https://wiki.debian.org/BuildingTutoria ... ut_changes
https://www.debian.org/doc/manuals/main ... ld.en.html

Q2. Using either approach from above, and just trying to initially (re)build the package from source without making any changes I'm hitting the same issue.
What I have done...
apt-get install build-essential fakeroot devscripts
apt-get source dosemu
apt-get install build-dep dsoemu

then from the two different threads above I have tried
dpkg-buildpackage -us -uc
and
debuild -b -uc -us

both yield same (similar) result below.
<<
---------------------------------DONE compiling-------------------------------
Now you must install DOSEMU. Make sure you are root and:
make install

make[2]: Leaving directory '/home/develop1/dosemu-1.4.0.7+20130105+b028d3f/src'
make[1]: Leaving directory '/home/develop1/dosemu-1.4.0.7+20130105+b028d3f'
dh_auto_test -O--parallel
create-stamp debian/debhelper-build-stamp
fakeroot debian/rules binary
dh binary --parallel
create-stamp debian/debhelper-build-stamp
dh_testroot -O--parallel
dh_prep -O--parallel
dh_installdirs -O--parallel
/home/develop1/dosemu-1.4.0.7+20130105+b028d3f/debian/dirs: 1: /home/develop1/dosemu-1.4.0.7+20130105+b028d3f/debian/dirs: etc/dosemu/freedos: not found
dh_installdirs: debian/dirs (executable config) returned exit code 127
debian/rules:3: recipe for target 'binary' failed
make: *** [binary] Error 127
dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2
debuild: fatal error at line 1116:
<<

Is this really looking for /etc/dosemu/freedos OR is that meant to be a subfolder of the build folder?
- - - - -
k829king
 
Posts: 13
Joined: 2018-08-26 09:47

Re: (Re)Building Packages Generally and Dosemu specifically

Postby arzgi » 2018-08-26 10:12

k829king wrote:I'm trying to rebuild the dosemu package on stretch.



Why would you do that, because dosemu is available as debian package:
Code: Select all
$ aptitude search dosemu
p   dosemu                          - DOS Emulator for Linux   
arzgi
 
Posts: 389
Joined: 2008-02-21 17:03
Location: Finland

Re: (Re)Building Packages Generally and Dosemu specifically

Postby k829king » 2018-08-26 10:46

because I want to make a small change, maybe I should have posted in the developers forum.
k829king
 
Posts: 13
Joined: 2018-08-26 09:47

Re: (Re)Building Packages Generally and Dosemu specifically

Postby stevepusser » 2018-08-26 22:39

The Debian sources include freedos, look on the right side of the page: https://packages.debian.org/stretch/dosemu

Did "apt-get source dosemu" download and extract all four of those source files?
The MX Linux repositories: Backports galore! If we don't have something, just ask and we'll try--we like challenges. New packages: Flightgear 2018.2.2, Pale Moon 28.2.0, wine-staging 3.20, GIMP 2.10.8, Cinnamon 3.8, Midori 6.0
User avatar
stevepusser
 
Posts: 10135
Joined: 2009-10-06 05:53

Re: (Re)Building Packages Generally and Dosemu specifically

Postby k829king » 2018-08-27 08:14

yes, the apt-get source dosemu pulled down the four files including the orig-freedos.tar.bz2.
Should that command also expand the tars, or is that part of the build process?

I'm trying to understand when it says "/debian/dirs: etc/dosemu/freedos: not found"
does it mean "/etc/dosemu/freedos" not found
or an "etc/dosemu/freedos" subfolder under the build folder?

There is an /etc/dosemu/freedos folder, it only contains two files autoexec.bat and config.sys,
but then this what is the case in a non development unit where the dosemu (not source) package has been installed.

The majority of freedos tar file contents appear to end up in /usr/lib/dosemu/

There is an "etc" folder under the build folder but then there is no freedos subfolder under that?
If one was required shouldn't the build script create that?
k829king
 
Posts: 13
Joined: 2018-08-26 09:47

Re: (Re)Building Packages Generally and Dosemu specifically

Postby stevepusser » 2018-08-27 22:47

Yes, the build process is supposed to handle all that stuff automatically. The "apt-get source" commands gets all the source files and extracts them correctly; the manual method is to download them and run "dpkg-source -x <whatever>.dsc".

Let me see if I can reproduce your build problem on my install.
The MX Linux repositories: Backports galore! If we don't have something, just ask and we'll try--we like challenges. New packages: Flightgear 2018.2.2, Pale Moon 28.2.0, wine-staging 3.20, GIMP 2.10.8, Cinnamon 3.8, Midori 6.0
User avatar
stevepusser
 
Posts: 10135
Joined: 2009-10-06 05:53

Re: (Re)Building Packages Generally and Dosemu specifically

Postby stevepusser » 2018-08-27 22:59

It built successfully on my system. I use a different method of automatically installing the build-depends using pbuilder-satisfydepends, as you can see used in my build command in the build log. That way I don't have to to go through the hassle of adding and disabling repositories.

Build log: https://drive.google.com/open?id=1Wxb1M ... 6fZlPjnTzi
The MX Linux repositories: Backports galore! If we don't have something, just ask and we'll try--we like challenges. New packages: Flightgear 2018.2.2, Pale Moon 28.2.0, wine-staging 3.20, GIMP 2.10.8, Cinnamon 3.8, Midori 6.0
User avatar
stevepusser
 
Posts: 10135
Joined: 2009-10-06 05:53

Re: (Re)Building Packages Generally and Dosemu specifically

Postby k829king » 2018-08-28 07:19

thankyou, started comparing the logs, answers one of my questions that it expects the "etc/dosemu/freedos/" folder under the build folder e.g. "debian/dosemu/etc/dosemu/freedos/"
If I read correctly from log (though of course maybe something is not written to it) that as per runtime deployment the only thing that ends up in "/etc/dosemu/freedos" are two dos files that are actually symlinked off /debian/dosemu/usr/lib/dosemu/drive_z/.
Just as a test, I created the debian/dosemu/etc/dosemu/freedos folder as your log seems to suggest it's just used for that symlinking.
But when I tried "debuild -b -uc -us" again it fails in the same way and the debian/dosemu/etc/dosemu/freedos folder no longer exists.
I'll try starting over and using a new build folder.
k829king
 
Posts: 13
Joined: 2018-08-26 09:47

Re: (Re)Building Packages Generally and Dosemu specifically

Postby k829king » 2018-08-28 17:14

So I created a new build folder.
Followed the instructions in https://wiki.debian.org/BuildingTutoria ... ut_changes
The pulling of the sources gave one a final response that I'm not clear on
<<
# apt-get source dosemu
Reading package lists... Done
Need to get 6,471 kB of source archives.
Get:1 http://ftp.uk.debian.org/debian stretch/contrib dosemu 1.4.0.7+20130105+b028d3f-2 (dsc) [2,414 B]
Get:2 http://ftp.uk.debian.org/debian stretch/contrib dosemu 1.4.0.7+20130105+b028d3f-2 (tar) [4,472 kB]
Get:3 http://ftp.uk.debian.org/debian stretch/contrib dosemu 1.4.0.7+20130105+b028d3f-2 (tar) [1,976 kB]
Get:4 http://ftp.uk.debian.org/debian stretch/contrib dosemu 1.4.0.7+20130105+b028d3f-2 (diff) [20.0 kB]
Fetched 6,471 kB in 1s (5,633 kB/s)
dpkg-source: info: extracting dosemu in dosemu-1.4.0.7+20130105+b028d3f
dpkg-source: info: unpacking dosemu_1.4.0.7+20130105+b028d3f.orig.tar.bz2
dpkg-source: info: unpacking dosemu_1.4.0.7+20130105+b028d3f.orig-freedos.tar.bz2
dpkg-source: info: unpacking dosemu_1.4.0.7+20130105+b028d3f-2.debian.tar.xz
dpkg-source: info: applying debianize.patch
dpkg-source: info: applying pc-tcp-packet-pad.patch
W: Download is performed unsandboxed as root as file 'dosemu_1.4.0.7+20130105+b028d3f-2.dsc' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)
>>
if I try debuild -b -uc -us
I get same result as before, complaining there is no etc/dosemu/freedos folder
k829king
 
Posts: 13
Joined: 2018-08-26 09:47

Re: (Re)Building Packages Generally and Dosemu specifically

Postby stevepusser » 2018-08-28 17:20

"debuild -b -uc -us"


I don't use the "-b" flag, so does it still fail with just "debuild -uc -us"?
Code: Select all
W: Download is performed unsandboxed as root
This is also odd. You're not running these commands as root, by chance? They are not meant to run that way.
The MX Linux repositories: Backports galore! If we don't have something, just ask and we'll try--we like challenges. New packages: Flightgear 2018.2.2, Pale Moon 28.2.0, wine-staging 3.20, GIMP 2.10.8, Cinnamon 3.8, Midori 6.0
User avatar
stevepusser
 
Posts: 10135
Joined: 2009-10-06 05:53

Re: (Re)Building Packages Generally and Dosemu specifically

Postby k829king » 2018-08-29 12:03

Thankyou!
I was running the "apt-get source dosemu" as root (well sudo) because I'm just so used to doing that with apt-get install.
Cleared my build folder, ran "apt-get source dosemu" as normal user and no sandbox message.
Then ran "debuild -uc -us" and it built the .deb successfully.

Next... If I want to test the .deb that was built do I "apt-get remove dosemu" and then use gdebi with the .deb I have built?
k829king
 
Posts: 13
Joined: 2018-08-26 09:47

Re: (Re)Building Packages Generally and Dosemu specifically

Postby k829king » 2018-08-29 14:27

Ok. I did "sudo apt-get remove dosemu" and used gdebi to install the .deb I just built that appeared to be ok from limited testing.

Next I made a small change, directly to the source with nano, which on re-reading https://wiki.debian.org/BuildingTutoria ... ource_code
Is where I went wrong, I should of been using the dpatch command.

The way I did it was make change directly, run debuild, got msg saying
<<
dpkg-source: error: aborting due to unexpected upstream changes, see /tmp/dosemu_1.4.0.7+20130105+b028d3f-2.diff.54kcDG
dpkg-source: info: you can integrate the local changes with dpkg-source --commit
>>

which I did the later and ran debuild and all seems okay, though probably not the right way.
k829king
 
Posts: 13
Joined: 2018-08-26 09:47

Re: (Re)Building Packages Generally and Dosemu specifically

Postby stevepusser » 2018-08-29 18:40

I use the "dpkg-source --commit" all the time to generate patches from changes in source code. I believe that the guide that recommends dpatch is out of date with the modern source format 3.0 (quilt) that most packages are using by now.

Any changes you make inside the debian folder don't need patches, such as if you make any changes to the package configuration in the debian/rules file (assuming there is a configuration there). For example, I was thinking of porting over libaom-dev from deb-multimedia and then adding the configuration flag in the Debian ffmpeg-4.0.2 in rules to support the hot new AV1 codec, but then I read that's the unoptimized reference library and is horribly slow...probably not worth the trouble at the present time.

But I do make changes in various other files in /debian when I backport an upstream Debian kernel: https://build.opensuse.org/package/show ... x-libc-dev

which are detailed in debian/changelog--debian tarball can be downloaded here: https://download.opensuse.org/repositor ... ebian_9.0/
The MX Linux repositories: Backports galore! If we don't have something, just ask and we'll try--we like challenges. New packages: Flightgear 2018.2.2, Pale Moon 28.2.0, wine-staging 3.20, GIMP 2.10.8, Cinnamon 3.8, Midori 6.0
User avatar
stevepusser
 
Posts: 10135
Joined: 2009-10-06 05:53

SOLVED: (Re)Building Packages Generally and Dosemu specifica

Postby k829king » 2018-08-30 10:47

Thankyou. Managed to do what I wanted.
The only thing I noted was that if I made change to the dosemu source with nano or Kate and then straight tried to do a "dpkg-source --commit" some errors were issued (apologies didn't trap them) if get time will try again and capture. But if I then following that attempt run debuild, it (as found before) fails requesting a commit, and if I then try the commit it works..... and then I can debuild?
K.
k829king
 
Posts: 13
Joined: 2018-08-26 09:47

Re: SOLVED: (Re)Building Packages Generally and Dosemu speci

Postby stevepusser » 2018-08-30 17:40

k829king wrote:Thankyou. Managed to do what I wanted.
The only thing I noted was that if I made change to the dosemu source with nano or Kate and then straight tried to do a "dpkg-source --commit" some errors were issued (apologies didn't trap them) if get time will try again and capture. But if I then following that attempt run debuild, it (as found before) fails requesting a commit, and if I then try the commit it works..... and then I can debuild?
K.


Yes, though technically the patch that gets created in debian/patches has a lot of boilerplate in the headers that should be filled in. But the most important line in the headers is that you explain what the patch is for, and the rest can be deleted if you're just making the changes for your own use.
The MX Linux repositories: Backports galore! If we don't have something, just ask and we'll try--we like challenges. New packages: Flightgear 2018.2.2, Pale Moon 28.2.0, wine-staging 3.20, GIMP 2.10.8, Cinnamon 3.8, Midori 6.0
User avatar
stevepusser
 
Posts: 10135
Joined: 2009-10-06 05:53


Return to Programming

Who is online

Users browsing this forum: No registered users and 1 guest

fashionable