I have a gtk+3
project written in python3
with file-structure (I am in Linux
):
$tree
.
├── autogen.sh
├── configure.ac
├── Makefile.am
├── mkbib.desktop.in
└── src
├── __init__.py #empty file
├── menubar.ui
├── menu.py
├── mkbib.py
├── pybib.py
└── view.py
the mkbib.py contains app.run()
:
$tail -5 mkbib.py
if __name__ == "__main__":
app = mkbib()
r = app.run(sys.argv)
sys.exit(r)
I am trying to create autotools as shown in developer.gnome site
It looks like:
$cat configure.ac
# This file is processed by autoconf to create a configure script
AC_INIT([mkbib], [1.0],[],[mkbib])
AM_INIT_AUTOMAKE([1.10 no-define foreign dist-xz no-dist-gzip])
AC_CONFIG_FILES([Makefile mkbib.desktop])
AC_OUTPUT
$cat Makefile.am
bin_SCRIPTS = mkbib
%.desktop: %.desktop.in
desktopdir = $(datadir)/applications
desktop_DATA = mkbib.desktop
dist_noinst_DATA = mkbib.desktop.in
mkbib:src/mkbib.py
and autogen.sh is complete copy as given in the link.
Now, If I am trying to run autogen.sh(This runs without error); make install, for make install, I am getting:
make install
make[1]: Entering directory '/home/rudra/Devel/mkbib/Python/Mkbib'
/usr/bin/mkdir -p '/var/tmp/bin'
/usr/bin/mkdir -p '/var/tmp/share/applications'
/usr/bin/install -c -m 644 mkbib.desktop '/var/tmp/share/applications'
make[1]: Leaving directory '/home/rudra/Devel/mkbib/Python/Mkbib'
As you can see, no executable mkbib
is created. Though, .desktop
file is placed in proper place
How I can create a single executable using autotools?
NB: As per python's standard, I have also tried setup.py, but I have failed even worse with that
LRN's Reply:
with bin_SCRIPTS = src/mkbib.py
I am getting:
$make install
make[1]: Entering directory '/home/rudra/Devel/mkbib/Python/Mkbib'
/usr/bin/mkdir -p '/home/rudra/.local/bin'
/usr/bin/install -c src/mkbib.py '/home/rudra/.local/bin'
/usr/bin/mkdir -p '/home/rudra/.local/share/applications'
/usr/bin/install -c -m 644 mkbib.desktop '/home/rudra/.local/share/applications'
make[1]: Leaving directory '/home/rudra/Devel/mkbib/Python/Mkbib'
$/home/rudra/.local/bin/mkbib.py
/home/rudra/.local/bin/mkbib.py: line 9: from: command not found
/home/rudra/.local/bin/mkbib.py: line 10: syntax error near unexpected token `"Gtk",'
/home/rudra/.local/bin/mkbib.py: line 10: `gi.require_version("Gtk", "3.0")'
$python3 /home/rudra/.local/bin/mkbib.py
Traceback (most recent call last):
File "/home/rudra/.local/bin/mkbib.py", line 3, in <module>
import menu
ImportError: No module named 'menu'