Repackaging a debian-git package

If none of the more specific forums is the right place to ask

Repackaging a debian-git package

Postby th0gz19 » 2019-11-03 02:04

Hello, I'm trying to update my .deb package to latest upstream git version of vim-youcompleteme.

https://tracker.debian.org/pkg/vim-youcompleteme

Can anyone give me a step-by-step on how to do this? No please don't direct me to links on how to do this or any documentation regarding the "The Debian Packaging System".
I want a simple step-by-step, I've already checked the documentations but I find it really vague, actually I've tried checking deb packaging many times before but gets perplexed each time because it's just too complicated for a simple job. Compared to slackware, packaging is always a breeze but I need the convenience of apt install <package>.

apt install <package> has always been good, but in this case I don't find it practical to learn "The Debian Packaging System" especially when I only need to update a single package.

I'll appreciate it and probably will give me a starting point on how to do this.

Thanks!
th0gz19
 
Posts: 7
Joined: 2019-11-03 01:40

Re: Repackaging a debian-git package

Postby Head_on_a_Stick » 2019-11-03 08:08

You'll have to figure out how to make Debian's patches work against the latest version, they won't apply cleanly.

To do this first add a deb-src line then update & grab the source:
Code: Select all
apt source vim-youcompleteme
cd vim-youcompleteme-*

Now download the latest git version with
Code: Select all
uscan

This will copy the new version to the directory above, change into that directory and run
Code: Select all
debuild -us -uc

The error messages will tell you where the patches fail.

Good luck!
Don't break DebianHow to report bugs

SharpBang GNU/Linux — a pre-configured Openbox/Tint2 desktop running on Debian stable
User avatar
Head_on_a_Stick
 
Posts: 10613
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Repackaging a debian-git package

Postby Soul Singin' » 2019-11-03 12:19

th0gz19 wrote:No please don't direct me to links on how to do this or any documentation regarding the "The Debian Packaging System".

Hmmm ... Maybe you should read the Debian New Maintainers' Guide, especially the part about "Getting Started the Right Way."

th0gz19 wrote:I want a simple step-by-step,

Did you search this forum before posting your question? Someone here wrote a step-by-step guide about "HowTo Build a Package from Source the Smart Way."

th0gz19 wrote:I've already checked the documentations but I find it really vague, actually I've tried checking deb packaging many times before but gets perplexed each time because it's just too complicated for a simple job.

Did you really read the documentation?

th0gz19 wrote:I don't find it practical to learn "The Debian Packaging System" especially when I only need to update a single package.

What is this? I want to know how to build a DEB without learning how to build a DEB?

Good Luck! You'll need it!
- Soul
User avatar
Soul Singin'
 
Posts: 1579
Joined: 2008-12-21 07:02

Re: Repackaging a debian-git package

Postby th0gz19 » 2019-11-03 14:31

Soul Singin' wrote:
th0gz19 wrote:No please don't direct me to links on how to do this or any documentation regarding the "The Debian Packaging System".

Hmmm ... Maybe you should read the Debian New Maintainers' Guide, especially the part about "Getting Started the Right Way."

th0gz19 wrote:I want a simple step-by-step,

Did you search this forum before posting your question? Someone here wrote a step-by-step guide about "HowTo Build a Package from Source the Smart Way."

th0gz19 wrote:I've already checked the documentations but I find it really vague, actually I've tried checking deb packaging many times before but gets perplexed each time because it's just too complicated for a simple job.

Did you really read the documentation?

th0gz19 wrote:I don't find it practical to learn "The Debian Packaging System" especially when I only need to update a single package.

What is this? I want to know how to build a DEB without learning how to build a DEB?

Good Luck! You'll need it!
- Soul


I did read the documentations and as much as possible I don't want to ask questions anywhere because of reactions like this but this time I really need help cause I've wasted so much time trying to comprehend and where the documentation is coming from. I think anybody who read that documentation without background about packaging yet benefitted a lot using `apt get` can relate here . I'm willing to learn it but I really need help this time so please.

Maybe if it's just a simple `debuild -uc -us` then I can do that. But I'm dealing with a deb package originated from a git repository and I'd like to make my own package (or repackage the outdated one). You didn't help btw and thanks to Head_on_a_Stick, at least I now know where to start.

EDIT: th0gz19 wrote:
I don't find it practical to learn "The Debian Packaging System" especially when I only need to update a single package.



What is this? I want to know how to build a DEB without learning how to build a DEB?

What I really meant by this is to I don't find it practical to learn the whole "Debian Packaging" since I only need to update a single package and `apt install <package>` just works most of the time.
th0gz19
 
Posts: 7
Joined: 2019-11-03 01:40

Re: Repackaging a debian-git package

Postby th0gz19 » 2019-11-03 15:17

So I have another question.

Here are the steps that I've taken so far:
Code: Select all
$ apt source vim-youcompleteme
cd vim-youcompleteme-*


After doing the steps above I did.
Code: Select all
$ gbp import-orig --uscan
isn't working cause it says
Code: Select all
gbp:error: ./deb/src/vim-youcompleteme-0+20190211+gitcbaf813 is not a git repository


So I did this instead:
Code: Select all
$ gbp import-dsc vim-youcompleteme_0+20190211+gitcbaf813-0.1.dsc
gbp:info: No git repository found, creating one.
gbp:info: Version '0+20190211+gitcbaf813-0.1' imported under './deb/src/vim-youcompleteme'

$ cd ../vim-youcompleteme
$ gbp import-orig --uscan
gbp:info: Launching uscan...
Cloning into bare repository '../vim-youcompleteme-temporary.10414.git'...
remote: Enumerating objects: 153, done.
remote: Counting objects: 100% (153/153), done.
remote: Compressing objects: 100% (137/137), done.
remote: Total 153 (delta 12), reused 84 (delta 3), pack-reused 0
Receiving objects: 100% (153/153), 352.66 KiB | 325.00 KiB/s, done.
Resolving deltas: 100% (12/12), done.
uupdate: -> Copy to      vim-youcompleteme_0+20191026+git3620fb5-1.debian.tar.xz
gbp:info: Using uscan downloaded tarball ../vim-youcompleteme_0+20191026+git3620fb5.orig.tar.xz
What is the upstream version? [0+20191026+git3620fb5]
gbp:info: Importing '../vim-youcompleteme_0+20191026+git3620fb5.orig.tar.xz' to branch 'upstream'...
gbp:info: Source package is vim-youcompleteme
gbp:info: Upstream version is 0+20191026+git3620fb5
gbp:info: Replacing upstream source on 'master'
gbp:info: Successfully imported version 0+20191026+git3620fb5 of ../vim-youcompleteme_0+20191026+git3620fb5.orig.tar.xz
In here I've got the latest update from the git repository right?

To make it simplier for myself, I've deleted the patches from ./debian/patches/series for now so there should be no problems with applying the patches. Gonna apply later if needed.

So let's say at this point I did and was successful:
Code: Select all
$ dpkg-source --commit
$ git add -A
$ git commit


So now my problem is. How am I going to specify which among python2 and python3 should the `debuild -uc -us` use?
Here's the last output I'm getting: (my home directory replaced with <home_directory>)

Code: Select all
debuild -uc -us
 dpkg-buildpackage -us -uc -ui
dpkg-buildpackage: info: source package vim-youcompleteme
dpkg-buildpackage: info: source version 0+20190211+gitcbaf813-0.1
dpkg-buildpackage: info: source distribution unstable
dpkg-buildpackage: info: source changed by David Kalnischkies <donkult@debian.org>
 dpkg-source --before-build .
dpkg-buildpackage: info: host architecture amd64
 debian/rules clean
dh clean --with python3
   dh_clean
 dpkg-source -b .
dpkg-source: info: using source format '3.0 (quilt)'
dpkg-source: info: building vim-youcompleteme using existing ./vim-youcompleteme_0+20190211+gitcbaf813.orig.tar.xz
dpkg-source: info: using patch list from debian/patches/series
dpkg-source: warning: ignoring deletion of file .travis.yml, use --include-removal to override
dpkg-source: warning: ignoring deletion of file appveyor.yml, use --include-removal to override
dpkg-source: warning: ignoring deletion of directory ci
dpkg-source: warning: ignoring deletion of directory ci/travis
dpkg-source: warning: ignoring deletion of file ci/travis/travis_install.sh, use --include-removal to override
dpkg-source: warning: ignoring deletion of directory ci/appveyor
dpkg-source: warning: ignoring deletion of file ci/appveyor/appveyor_install.bat, use --include-removal to override
dpkg-source: warning: ignoring deletion of directory .circleci
dpkg-source: warning: ignoring deletion of file .circleci/install_dependencies.sh, use --include-removal to override
dpkg-source: warning: ignoring deletion of file .circleci/config.yml, use --include-removal to override
dpkg-source: info: building vim-youcompleteme in vim-youcompleteme_0+20190211+gitcbaf813-0.1.debian.tar.xz
dpkg-source: info: building vim-youcompleteme in vim-youcompleteme_0+20190211+gitcbaf813-0.1.dsc
 debian/rules binary
dh binary --with python3
   dh_update_autotools_config
   dh_autoreconf
   debian/rules override_dh_auto_test
make[1]: Entering directory '<home_directory>/deb/src/vim-youcompleteme'
LC_ALL=C.UTF-8 PYTHONPATH=/usr/lib/ycmd ./run_tests.py --skip-build --no-flake8
/usr/bin/python: No module named nose
Traceback (most recent call last):
  File "./run_tests.py", line 100, in <module>
    Main()
  File "./run_tests.py", line 96, in Main
    NoseTests( parsed_args, nosetests_args )
  File "./run_tests.py", line 88, in NoseTests
    subprocess.check_call( [ sys.executable, '-m', 'nose' ] + nosetests_args )
  File "/usr/lib/python2.7/subprocess.py", line 190, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/usr/bin/python', '-m', 'nose', '-v', '--with-id', '<home_directory>/deb/src/vim-youcompleteme/python']' returned non-zero exit status 1
make[1]: *** [debian/rules:19: override_dh_auto_test] Error 1
make[1]: Leaving directory '<home_directory>/deb/src/vim-youcompleteme'
make: *** [debian/rules:8: binary] Error 2
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2
debuild: fatal error at line 1182:
dpkg-buildpackage -us -uc -ui failed


I have to use python3 cause that's the version where I have python3-nose installed but it's not finding it.
th0gz19
 
Posts: 7
Joined: 2019-11-03 01:40

Re: Repackaging a debian-git package

Postby th0gz19 » 2019-11-03 15:25

Now I think what I need to do is
Code: Select all
$ git submodule update --init --recursive


How am I going to do this the debian way?
th0gz19
 
Posts: 7
Joined: 2019-11-03 01:40

Re: Repackaging a debian-git package

Postby Head_on_a_Stick » 2019-11-03 15:46

th0gz19 wrote:After doing the steps above I did.
Code: Select all
$ gbp import-orig --uscan
isn't working cause it says
Code: Select all
gbp:error: ./deb/src/vim-youcompleteme-0+20190211+gitcbaf813 is not a git repository


So I did this instead:
Code: Select all
$ gbp import-dsc vim-youcompleteme_0+20190211+gitcbaf813-0.1.dsc
[...]

No need for gbp(1), just run my commands as posted. They might even just work™ if you've removed the debian/patches directory.
Don't break DebianHow to report bugs

SharpBang GNU/Linux — a pre-configured Openbox/Tint2 desktop running on Debian stable
User avatar
Head_on_a_Stick
 
Posts: 10613
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Repackaging a debian-git package

Postby th0gz19 » 2019-11-03 16:04

Code: Select all
 $ debuild -us -uc
 dpkg-buildpackage -us -uc -ui
dpkg-buildpackage: info: source package vim-youcompleteme
dpkg-buildpackage: info: source version 0+20191026+git3620fb5-1
dpkg-buildpackage: info: source distribution UNRELEASED
dpkg-buildpackage: info: source changed by FirstName LastName <user@debian>
 dpkg-source --before-build .
dpkg-buildpackage: info: host architecture amd64
 debian/rules clean
dh clean --with python3
   dh_clean
 dpkg-source -b .
dpkg-source: info: using source format '3.0 (quilt)'
dpkg-source: info: building vim-youcompleteme using existing ./vim-youcompleteme_0+20191026+git3620fb5.orig.tar.xz
dpkg-source: info: building vim-youcompleteme in vim-youcompleteme_0+20191026+git3620fb5-1.debian.tar.xz
dpkg-source: info: building vim-youcompleteme in vim-youcompleteme_0+20191026+git3620fb5-1.dsc
 debian/rules binary
dh binary --with python3
   dh_update_autotools_config
   dh_autoreconf
   debian/rules override_dh_auto_test
make[1]: Entering directory '<home_directory>/deb/src/vim-youcompleteme-0+20191026+git3620fb5'
LC_ALL=C.UTF-8 PYTHONPATH=/usr/lib/ycmd ./run_tests.py --skip-build --no-flake8
/usr/bin/python: No module named nose
Traceback (most recent call last):
  File "./run_tests.py", line 100, in <module>
    Main()
  File "./run_tests.py", line 96, in Main
    NoseTests( parsed_args, nosetests_args )
  File "./run_tests.py", line 88, in NoseTests
    subprocess.check_call( [ sys.executable, '-m', 'nose' ] + nosetests_args )
  File "/usr/lib/python2.7/subprocess.py", line 190, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/usr/bin/python', '-m', 'nose', '-v', '--with-id', '<home_directory>/deb/src/vim-youcompleteme-0+20191026+git3620fb5/python']' returned non-zero exit status 1
make[1]: *** [debian/rules:19: override_dh_auto_test] Error 1
make[1]: Leaving directory '<home_directory>/deb/src/vim-youcompleteme-0+20191026+git3620fb5'
make: *** [debian/rules:8: binary] Error 2
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2
debuild: fatal error at line 1182:
dpkg-buildpackage -us -uc -ui failed


Hi, I ended up in the same wall I ran into.
How am I supposed to run `git submodule update --init --recursive` first before or while I run `debuild -us -uc`?
I think this is now the git repository requiring the `git submodule` step.
th0gz19
 
Posts: 7
Joined: 2019-11-03 01:40

Re: Repackaging a debian-git package

Postby Soul Singin' » 2019-11-04 00:32

If you're not willing to read documentation, then at least read the error messages. . :roll:

th0gz19 wrote:
Code: Select all
dh binary --with python3

But it's trying to build with python2. See below:

th0gz19 wrote:
Code: Select all
  File "/usr/lib/python2.7/subprocess.py", line 190, in check_call
User avatar
Soul Singin'
 
Posts: 1579
Joined: 2008-12-21 07:02

Re: Repackaging a debian-git package

Postby th0gz19 » 2019-11-04 02:12

Soul Singin' wrote:If you're not willing to read documentation, then at least read the error messages. . :roll:

th0gz19 wrote:
Code: Select all
dh binary --with python3

But it's trying to build with python2. See below:

th0gz19 wrote:
Code: Select all
  File "/usr/lib/python2.7/subprocess.py", line 190, in check_call


Hello, I was able to sort it out.
I've just installed a update-alternatives for python.

Was able to build the .deb package. However the app is not working for me after installing.
From what I read somewhere I need to
Code: Select all
 $ git submodule update --init --recursive

before building but I really have no clue how to do this in a non-git directory.

I was doing
Code: Select all
 $ gbp buildpackage --git-submodules --git-ignore-new
but I can't remember what the problem was. I'm really confused and frustrated :lol:
That's why I was asking how to do it while using `debuild -uc -us`

Kind of gave up last night and continue working on something else.
Gonna go back to documentation (for I don't know how many times I've lost count) next time I have the time.
th0gz19
 
Posts: 7
Joined: 2019-11-03 01:40

Re: Repackaging a debian-git package

Postby Soul Singin' » 2019-11-04 07:56

th0gz19 wrote:I've just installed a update-alternatives for python.

That's a great way to b0rk your system.

Ben Finney wrote:Michael Milliman <michael.e.milliman@gmail.com> writes:

> I currently have both Python 2.7 and Python 3.4 installed on my debain
> 8.5 (jessie) system. The default Python interpreter on the system is
> Python 2.7 (as linked by /usr/bin/python).

The policy for Python in Debian requires that “/usr/bin/python’ is the
default Python 2 interpreter, and ‘/usr/bin/python3’ is the default
Python 3 interpreter.

There is no “default Python interpreter” in Debian. Python 2 and Python
3 are incompatible run-time systems.

> I would prefer [the ‘/usr/bin/python’ interpreter] to be Python 3.4.

That would violate Debian Python policy. You are free to do it on your
own system, but it will likely break many Python packages on Debian, and
you get to keep all the pieces :-)

And here is what one of the broken pieces will look like:

Will wrote:But it wasn't long before I realised I had broken apt/aptitude when it comes to installing and removing python packages because apt was expecting python2
User avatar
Soul Singin'
 
Posts: 1579
Joined: 2008-12-21 07:02

Re: Repackaging a debian-git package

Postby th0gz19 » 2019-11-04 08:40

Soul Singin' wrote:
th0gz19 wrote:I've just installed a update-alternatives for python.

That's a great way to b0rk your system.

Ben Finney wrote:Michael Milliman <michael.e.milliman@gmail.com> writes:

> I currently have both Python 2.7 and Python 3.4 installed on my debain
> 8.5 (jessie) system. The default Python interpreter on the system is
> Python 2.7 (as linked by /usr/bin/python).

The policy for Python in Debian requires that “/usr/bin/python’ is the
default Python 2 interpreter, and ‘/usr/bin/python3’ is the default
Python 3 interpreter.

There is no “default Python interpreter” in Debian. Python 2 and Python
3 are incompatible run-time systems.

> I would prefer [the ‘/usr/bin/python’ interpreter] to be Python 3.4.

That would violate Debian Python policy. You are free to do it on your
own system, but it will likely break many Python packages on Debian, and
you get to keep all the pieces :-)

And here is what one of the broken pieces will look like:

Will wrote:But it wasn't long before I realised I had broken apt/aptitude when it comes to installing and removing python packages because apt was expecting python2


I see so that's the reason why it wasn't listed when I query python with update-alternatives. It actually broke last night but I can't remember now what I did. I was too pre-occupied with updating this application (desperately). Would it be a good idea if I start with creating a virtual environment for python?
th0gz19
 
Posts: 7
Joined: 2019-11-03 01:40


Return to General Questions

Who is online

Users browsing this forum: No registered users and 12 guests

fashionable