QT程序在meego系统上的发布问题
写了个qt程序,做成的rpm包在虚拟机上只能用root用户安装运行,原因可能是什么? 而且只会用命令行安装,怎么图形化浏览文件? 一般怎么发布?
[解决办法]
用qt-creator
http://www.meegox.com/thread-1555-1-1.html
[解决办法]
关注一下
[解决办法]
试试Intel的AppUp
[解决办法]
给你个例子,主要是写好 pro 文件,然后qmake,make、make rpm就可以直接打包生成rpm包了,这里需要写好spec文件。
leos@leos-laptop:test-music $ ls -lh
total 30M
-rw-r--r-- 1 leos leos 1.4K 2011-12-29 10:02 ax.pro
drwxr-xr-x 2 leos leos 4.0K 2011-12-30 16:35 build
drwxr-xr-x 3 leos leos 4.0K 2011-12-29 13:14 data
-rw-r--r-- 1 leos leos 29K 2011-12-30 10:59 Makefile
-rw-r--r-- 1 leos leos 26K 2011-12-29 10:02 netmusicDown.png
-rw-r--r-- 1 leos leos 26K 2011-12-29 10:02 netmusic.png
-rwxr-xr-x 1 leos leos 2.4M 2011-12-30 16:36 test-music
-rw-r--r-- 1 leos leos 4.5M 2011-12-29 10:02 test-music-0.1.0.tar.gz
-rw-r--r-- 1 leos leos 3.0K 2011-12-29 18:34 test-music.pro
-rw-r--r-- 1 leos leos 4.3K 2011-12-29 10:02 test-music.qrc
-rw-r--r-- 1 leos leos 1.5K 2011-12-29 17:43 test-music.spec
-rw-r--r-- 1 leos leos 9.8M 2011-12-29 10:02 qrc_test-music.cpp
-rw-r--r-- 1 leos leos 449 2011-12-29 10:02 qrc.sh
drwxr-xr-x 2 leos leos 4.0K 2012-01-04 10:07 src
leos@leos-laptop:test-music $ cat test-music.pro
######################################################################
# Automatically generated by qmake (2.01a) ?? 7? 14 15:30:33 2011
######################################################################
NAME = test-music
VERSION = -0.1.0
TEMPLATE = app
TARGET = $${NAME}
DEPENDPATH += .
INCLUDEPATH += .
OBJECTS_DIR = build
MOC_DIR = build
DISTFILES += data/*.png \
data/wait/*.png \
data/*.db \
data/*.service \
data/*.desktop \
*.png
icon.files = *.png
icon.path = /usr/share/pixmaps
INSTALLS += icon
desktop.files = data/*.desktop
desktop.path = /usr/share/applications/desktop
INSTALLS += desktop
db.files = data/*.db
db.path = /usr/share/$${NAME}/
INSTALLS += db
dbusService.files = data/*.service
dbusService.path = /usr/share/dbus-1/services/
INSTALLS += dbusService
target.path = /usr/bin
INSTALLS += target
QT += network xml sql dbus phonon
unix{
CONFIG += link_pkgconfig
PKGCONFIG += glib-2.0 x11 gstreamer-0.10
LIBS += -lgstinterfaces-0.10
}
# Input
HEADERS += src/app-scene.h \
src/button.h \
src/cate-button.h \
src/category.h \
src/global.h \
src/list.h \
src/play.h \
src/reverse-button.h \
src/view-manager.h \
src/network-xml.h \
src/downloadThread.h \
src/analyzing-xml.h \
src/database.h \
src/list-button.h \
src/timer.h \
src/loadanimation.h \
src/mediaplay.h \
src/push.h \
src/push-list-button.h \
src/media.h \
src/timer-for-play.h
SOURCES += src/app-scene.cpp \
src/button.cpp \
src/cate-button.cpp \
src/category.cpp \
src/list.cpp \
src/main.cpp \
src/play.cpp \
src/reverse-button.cpp \
src/view-manager.cpp \
src/network-xml.cpp \
src/downloadThread.cpp \
src/analyzing-xml.cpp \
src/database.cpp \
src/list-button.cpp \
src/timer.cpp \
src/loadanimation.cpp \
src/mediaplay.cpp \
src/push.cpp \
src/push-list-button.cpp \
src/media.cpp \
src/timer-for-play.cpp
RESOURCES += $${NAME}.qrc
clear.commands += rm -fr *.tar.gz *.rpm rpmbuild
clear.depends = clean distclean
rpm.target = rpm
rpm.commands = \
rm -fr rpmbuild \
rm -rf .tmp \
&& mkdir -p rpmbuild/{SOURCES,SPECS,SRPMS,RPMS,BUILD,BUILDROOT} \
&& cp *.spec rpmbuild/SPECS/ \
&& cp *.tar.gz rpmbuild/SOURCES/ \
&& rpmbuild --define="_topdir `pwd`/rpmbuild" -ba $${NAME}.spec \
&& mv rpmbuild/RPMS/i386/*.rpm . \
&& mv rpmbuild/SRPMS/*.rpm . \
&& rm -rf rpmbuild \
&& make distclean
# order is important, because, "make dist" needs "qrc_*.cpp" which is generated by "make first"
rpm.depends = first dist
QMAKE_EXTRA_TARGETS += rpm clear
leos@leos-laptop:test-music $ cat test-music.spec
%define debug_packages %{nil}
%define debug_package %{nil}
Name:test-music
Version:0.1.0
Release:5.tc%{?dist}
Summary:music online by QT
Group:Applications/Multimedia
License:Asianux
URL:www.asianux.com
Source0:%{name}-%{version}.tar.gz
BuildRoot:%{_tmppath}/%{name}-root
#Requires: demo-server
%description
music online by QT ...
%prep
%setup -q
%build
qmake
make
%install
make INSTALL_ROOT=%{buildroot} install
%clean
%files
%defattr(-,root,root,-)
%{_bindir}/test-music
%{_datadir}/test-music/*.db
%{_datadir}/pixmaps/*.png
%{_datadir}/applications/desktop/*.desktop
%{_datadir}/dbus-1/services/*.service
%changelog