Need help in building a package

Greetings,

I am trying to build a package (oomox) via https://build.opensuse.org. It has a succeeded status but I cannot install it via YAST, I get /bin/env dependency error. I know that it should be /usr/bin/env, but how can I fix this?

Here you may see my spec and source files:

https://build.opensuse.org/package/show/home:HidDeNeR/oomox

I would appreciate any help.

Hi
So why not use the makefile to install etc? I’m guessing all those requires, plus if you look at the rpmlint report for clues.

Desktop files need you to run %suse_update_desktop_file macro and well as %post and %postun routines…

I’m assuming this is your first foray into packaging?

Yep, one of my first packages. Still bin/env dependency error when installing via YAST. The shebangs from source (python) files are #!bin/env and I guess that causes the problem after build? Should read more documentation, I’ve just used the info from Arch pkgbuild :slight_smile:

P.S. Package deleted. Ignore the link.

Hi
Happy to help you work through building it if you want…?

Best place to start is looking at the spec files on packages similar to what your wanting, eg a icon theme package would have a few things you need…

If there something else you want to try building, just post back and ask :slight_smile:

Thanks for your time. I really appreciate it. I have updated my spec, could you have a look and tell me what else should be included?

https://build.opensuse.org/package/show/home:HidDeNeR/oomox

I get a bunch of warnings in the log file. How to mark a folder as %config? I can’t find it in documentation. For duplicate files I use %fdupes, but I still get the warnings (I guess it is not used correctly).

And how to tell the build process to change all #!/bin/env to #!/usr/bin/env. I am not sure, but I guess it should be built with #!/usr/bin/env (otherwise I get that dependency error in YAST).

Thank you in advance.

Before:


%files
.............
/foo/bar

After:


%files
............
%config /foo/bar

AK

On Tue 08 Nov 2016 07:46:03 AM CST, HidDeNeR wrote:

I get a bunch of warnings in the log file. How to mark a folder as
%config? I can’t find it in documentation. For duplicate files I use
%fdupes, but I still get the warnings (I guess it is not used
correctly).

Thank you in advance.

Hi
If you have a look at some of the python package specs they use perl to
change the shebang…

For example in the %prep section;


Get rid of non-executable-script python warnings
find src/freeseer/ -type f -name '*.py' | while read f; do
perl -n -i -e 'print unless $.==1 && m/^#!/' "$f"
done


Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
openSUSE Leap 42.1|GNOME 3.16.2|4.1.34-33-default
If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below… Thanks!

Thanks!

I have just found a sed/grep way:

# fix shebangs - convert /usr/local/bin/python and /usr/bin/env/python to /usr/bin/python3
for dir in Lib Tools; do
    # find *.py, filter to files that contain bad shebangs
    find $dir -name '*.py' -type f -print0 \
        | xargs -0 grep -lE '^#! *(/usr/.*bin/(env +)?)?python' \
        | xargs sed -r -i -e '1s@^#!:space:]]*(/usr/(local/)?bin/(env +)?)?python([0-9]+(\.[0-9]+)?)?@#!/usr/bin/python3@'
done

So I need to convert #!/bin/env python3 to #!/usr/bin/env python3, or even better to !#/usr/bin/python3 (as in the example above). I changed it to

# fix shebangs - convert /usr/local/bin/python and /usr/bin/env/python to /usr/bin/python3
for dir in gui; do
    # find *.py, filter to files that contain bad shebangs
    find $dir -name '*.py' -type f -print0 \
        | xargs -0 grep -lE '^#! *(/bin/(env +)?)?python3@' \
        | xargs sed -r -i -e '1s@^#!:space:]]*(/bin/(env +)?)?python3@?@#!/usr/bin/python3@'
done

However, I get a “sed: no input files” error :slight_smile: I have no experience with it, need help!

On Tue 08 Nov 2016 04:46:01 PM CST, HidDeNeR wrote:

Thanks!

I have just found a sed/grep way:

Code:

fix shebangs - convert /usr/local/bin/python

and /usr/bin/env/python to /usr/bin/python3 for dir in Lib Tools; do

find *.py, filter to files that contain bad shebangs

find $dir -name ‘*.py’ -type f -print0
| xargs -0 grep -lE ‘^#! *(/usr/.bin/(env +)?)?python’
| xargs sed -r -i -e '1s@^#!:space:]]
(/usr/(local/)?bin/(env
+)?)?python([0-9]+(.[0-9]+)?)?@#!/usr/bin/python3@’ done

So I need to convert #!/bin/env python3 to #!/usr/bin/env python3, or
even better to !#/usr/bin/python3 (as in the example above). I changed
it to

Code:

fix shebangs - convert /usr/local/bin/python

and /usr/bin/env/python to /usr/bin/python3 for dir in gui; do

find *.py, filter to files that contain bad shebangs

find $dir -name ‘*.py’ -type f -print0
| xargs -0 grep -lE ‘^#! (/bin/(env +)?)?python3@’
| xargs sed -r -i -e '1s@^#!:space:]]
(/bin/(env
+)?)?python3@?@#!/usr/bin/python3@’ done

However, I get a “sed: no input files” error :slight_smile: I have no experience
with it, need help!

Hi
In your case I thought it was the /bin/env shebang?

Yes, all you would need to do is find /bin/env with /usr/bin/env


Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
openSUSE Leap 42.1|GNOME 3.16.2|4.1.34-33-default
If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below… Thanks!

Thanks, again! Finally, it works! :slight_smile:

Hi
Thanks for the feedback :slight_smile: So it’s also working as expected?

It generates the themes. However, by using a preset from the list it generates a theme which gives me a white panel background (even if it is set dark). It just looks as the most themes which have gtk3.20 issues. But oomox was created to get rid of these issues, confused… something is wrong with the app or the package.

I tested oomox before (a couple of months ago) using the github readme and it worked as expected.

Hi
Or a wayland issue if that’s being used, switch back to GNOME on Xorg, you can check what’s in use via System Settings and Details.

I use XFCE, so it’s not wayland? I tested it before on XFCE or MATE, can’t remember exactly.

Hi
Ahh, OK, not sure then, must be something lurking. Create a new user and login and configure a theme and see how that goes, if it duplicates then it’s probably a packaging issue…

I have just tested more presets and some of them work. I will keep an eye on this app and see what changes. Many thanks :slight_smile: