On Monday 01 of November 2010 09:52:22 Denny Beyer wrote:
Dear all java packagers,
I'm having an issue with creating a start script from within my spec file.
The following line should be written to a shell script
java -jar %{_datadir}/%{name}/%{name}.jar `${@}`
to start the program, which works fine, except for the command line options. In the shell script the line looks like this:
java -jar %{_datadir}/%{name}/%{name}.jar ` `
which doesn't help. I tried several exclamation marks, but none gave me the " $@ " in the created script.
any help is much appreciated.
Hi Danny, Here Documents [1] can suppress the variable and command expansion, so the cat <<'EOF' > %{buildroot}/%{_bindir}/%{name} #!/bin/bash java -jar %{_datadir}/%{name}/%{name}.jar `${@}` EOF There are few examples, how to write the script - jedit.spec [2], which comfors to the jpackage.org standards, or the example in Java packaging guidelines [3]. [1] http://tldp.org/LDP/abs/html/here-docs.html [2] https://build.opensuse.org/package/view_file?file=jedit.spec&package=jedit&project=openSUSE%3AFactory&srcmd5=a8cda978f0fa857b3c826cd6a4b85e87 [3] http://en.opensuse.org/openSUSE:Packaging_Java Regards Michal Vyskocil
Denny