| View previous topic :: View next topic |
| Author |
Message |
arnelj n00b

Joined: 08 Jan 2004 Posts: 40 Location: Uppsala, Sweden
|
Posted: Sun Nov 04, 2012 1:39 pm Post subject: Troble making ebuild for telldius-core |
|
|
Hi,
I try to make an ebuild for the telldius-core-2.1.1, the code can be compiled and installed into my system by these actions:
adding "#include <unistd.h>" into file telldus-core-2.1.1/common/Socket_unix.cpp
Then:
cmake .
make
make install
ldconfig
The current ebuild looks like this:
| Code: | # Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-analyzer/openvas-manager/openvas-manager-2.0.4.ebuild,v 1.2 2012/05/04 06:08:10 jdhore Exp $
EAPI="2"
RESTRICT="primaryuri"
inherit cmake-utils
DESCRIPTION="Cli for tellstick house automation transmitter/reciever"
HOMEPAGE="http://www.telldus.se/"
SRC_URI="http://download.telldus.se/TellStick/Software/telldus-core/${P}.tar.gz"
SLOT="0"
LICENSE="LGPL-2"
KEYWORDS="~amd64 ~arm ~x86"
IUSE=""
RDEPEND=""
DEPEND="${RDEPEND}
virtual/pkgconfig
dev-util/cmake"
src_prepare() {
epatch "${FILESDIR}"/telldus-core-2.1.1_fix_missing_include.patch
}
src_configure() {
cmake-utils_src_configure
}
src_install() {
emake DESTDIR="${D}" install
}
pkg_postinst() {
elog "Start /usr/local/sbin/telldusd before use of service"
} |
and the patch file looks like this:
| Code: | --- common/Socket_unix.cpp.orig 2012-11-04 13:21:56.000000000 +0100
+++ common/Socket_unix.cpp 2012-11-04 13:21:56.000000000 +0100
@@ -7,6 +7,7 @@
#include <sys/socket.h>
#include <sys/un.h>
#include <math.h>
+#include <unistd.h>
#define BUFSIZE 512 |
When I run the ebuild by the command "ACCEPT_KEYWORDS="~amd64" emerge -av telldus-core" I get this: (last part shown)
| Code: | [ 18%] Building CXX object common/CMakeFiles/TelldusCommon.dir/EventHandler_unix.cpp.o
cd /var/tmp/portage/dev-util/telldus-core-2.1.1/work/telldus-core-2.1.1_build/common && /usr/bin/x86_64-pc-linux-gnu-g++ -D_LINUX -DNDEBUG -march=core2 -O2 -pipe -fPIC -fvisibility=hidden -o CMakeFiles/TelldusCommon.dir/EventHandler_unix.cpp.o -c /var/tmp/portage/dev-util/telldus-core-2.1.1/work/telldus-core-2.1.1/common/EventHandler_unix.cpp
/usr/bin/cmake -E cmake_progress_report /var/tmp/portage/dev-util/telldus-core-2.1.1/work/telldus-core-2.1.1_build/CMakeFiles 8
[ 20%] Building CXX object common/CMakeFiles/TelldusCommon.dir/Socket_unix.cpp.o
cd /var/tmp/portage/dev-util/telldus-core-2.1.1/work/telldus-core-2.1.1_build/common && /usr/bin/x86_64-pc-linux-gnu-g++ -D_LINUX -DNDEBUG -march=core2 -O2 -pipe -fPIC -fvisibility=hidden -o CMakeFiles/TelldusCommon.dir/Socket_unix.cpp.o -c /var/tmp/portage/dev-util/telldus-core-2.1.1/work/telldus-core-2.1.1/common/Socket_unix.cpp
Linking CXX static library libTelldusCommon.a
cd /var/tmp/portage/dev-util/telldus-core-2.1.1/work/telldus-core-2.1.1_build/common && /usr/bin/cmake -P CMakeFiles/TelldusCommon.dir/cmake_clean_target.cmake
cd /var/tmp/portage/dev-util/telldus-core-2.1.1/work/telldus-core-2.1.1_build/common && /usr/bin/cmake -E cmake_link_script CMakeFiles/TelldusCommon.dir/link.txt --verbose=1
/usr/bin/x86_64-pc-linux-gnu-ar cr libTelldusCommon.a CMakeFiles/TelldusCommon.dir/Event.cpp.o CMakeFiles/TelldusCommon.dir/Message.cpp.o CMakeFiles/TelldusCommon.dir/Mutex.cpp.o CMakeFiles/TelldusCommon.dir/Strings.cpp.o CMakeFiles/TelldusCommon.dir/Thread.cpp.o CMakeFiles/TelldusCommon.dir/Event_unix.cpp.o CMakeFiles/TelldusCommon.dir/EventHandler_unix.cpp.o CMakeFiles/TelldusCommon.dir/Socket_unix.cpp.o
/usr/bin/x86_64-pc-linux-gnu-ranlib libTelldusCommon.a
make[2]: Lämnar katalogen "/var/tmp/portage/dev-util/telldus-core-2.1.1/work/telldus-core-2.1.1_build"
/usr/bin/cmake -E cmake_progress_report /var/tmp/portage/dev-util/telldus-core-2.1.1/work/telldus-core-2.1.1_build/CMakeFiles 1 2 3 4 5 6 7 8
[ 20%] Built target TelldusCommon
make[1]: Lämnar katalogen "/var/tmp/portage/dev-util/telldus-core-2.1.1/work/telldus-core-2.1.1_build"
make: *** [all] Fel 2
emake failed
* ERROR: dev-util/telldus-core-2.1.1 failed (compile phase):
* Make failed!
*
* Call stack:
* ebuild.sh, line 93: Called src_compile
* environment, line 2783: Called cmake-utils_src_compile
* environment, line 751: Called _execute_optionaly 'src_compile'
* environment, line 269: Called enable_cmake-utils_src_compile
* environment, line 1000: Called cmake-utils_src_make
* environment, line 776: Called die
* The specific snippet of code:
* emake VERBOSE=1 "$@" || die "Make failed!";
*
* If you need support, post the output of `emerge --info '=dev-util/telldus-core-2.1.1'`,
* the complete build log and the output of `emerge -pqv '=dev-util/telldus-core-2.1.1'`.
* This ebuild is from an overlay named 'local-repo': '/usr/local/portage/'
* The complete build log is located at '/var/tmp/portage/dev-util/telldus-core-2.1.1/temp/build.log'.
* The ebuild environment file is located at '/var/tmp/portage/dev-util/telldus-core-2.1.1/temp/environment'.
* Working directory: '/var/tmp/portage/dev-util/telldus-core-2.1.1/work/telldus-core-2.1.1_build'
* S: '/var/tmp/portage/dev-util/telldus-core-2.1.1/work/telldus-core-2.1.1' |
I cant find the reason why the linking phase at 20% fails. Any ideas? |
|
| Back to top |
|
 |
arnelj n00b

Joined: 08 Jan 2004 Posts: 40 Location: Uppsala, Sweden
|
Posted: Sun Nov 04, 2012 7:31 pm Post subject: |
|
|
Hi, again
I think there was a problem with the working directory, by changing it, the problem disappeared.
The new ebuild looks like this
| Code: | # Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-analyzer/openvas-manager/openvas-manager-2.0.4.ebuild,v 1.2 2012/05/04 06:08:10 jdhore Exp $
EAPI="4"
RESTRICT="primaryuri"
inherit cmake-utils
DESCRIPTION="Cli for tellstick house automation transmitter/reciever"
HOMEPAGE="http://www.telldus.se/"
SRC_URI="http://download.telldus.se/TellStick/Software/telldus-core/${P}.tar.gz"
SLOT="0"
LICENSE="LGPL-2"
KEYWORDS="~amd64 ~arm ~x86"
IUSE=""
RDEPEND=""
DEPEND="${RDEPEND}
virtual/pkgconfig
dev-util/cmake"
src_prepare() {
epatch "${FILESDIR}"/telldus-core-2.1.1_fix_missing_include.patch
epatch "${FILESDIR}"/telldus-core-2.1.1_fix_wrong_udev_location.patch
}
src_configure() {
cmake-utils_src_configure
}
src_compile() {
cd "${CMAKE_BUILD_DIR}"
make || die "make failed"
}
pkg_postinst() {
elog "Configure your devices by editing the /etc/tellstick.conf file"
elog "Start /usr/sbin/telldusd before use of service"
elog " "
}
|
one more patchfile was also needed. (telldus-core-2.1.1_fix_wrong_udev_location.patch)
| Code: | --- tdadmin/CMakeLists.txt.orig 2012-04-11 19:44:46.000000000 +0200
+++ tdadmin/CMakeLists.txt 2012-04-11 19:44:46.000000000 +0200
@@ -59,7 +59,7 @@
INSTALL(TARGETS tdadmin RUNTIME DESTINATION sbin)
IF (UNIX AND NOT APPLE)
- SET(UDEV_RULES_DIR "/etc/udev/rules.d" CACHE PATH "The directory where udev store its rules" )
+ SET(UDEV_RULES_DIR "/lib/udev/rules.d" CACHE PATH "The directory where udev store its rules" )
CONFIGURE_FILE(
${CMAKE_CURRENT_SOURCE_DIR}/05-tellstick.rules
${CMAKE_BINARY_DIR}/parsed/05-tellstick.rules
|
The application can control a tellstick device that controls rf controlled switches used for home automation. |
|
| Back to top |
|
 |
Hu Watchman

Joined: 06 Mar 2007 Posts: 7679
|
Posted: Mon Nov 05, 2012 2:30 am Post subject: |
|
|
| arnelj wrote: | | Code: |
src_compile() {
cd "${CMAKE_BUILD_DIR}"
make || die "make failed"
}
|
| You should use emake, not make. |
|
| Back to top |
|
 |
arnelj n00b

Joined: 08 Jan 2004 Posts: 40 Location: Uppsala, Sweden
|
Posted: Mon Nov 05, 2012 4:33 pm Post subject: |
|
|
Hi,
I tried that, but then I got the same error as in the first post. I hadn't figured out why.
the make instead of emake probably hides some unwanted behaviours in the telldus-core makefiles. |
|
| Back to top |
|
 |
Hu Watchman

Joined: 06 Mar 2007 Posts: 7679
|
Posted: Tue Nov 06, 2012 2:21 am Post subject: |
|
|
| If you use make, then user $MAKEOPTS are not respected. This means the build will be serial, which can work around bugs in upstream build systems. However, if the problem is that the upstream build is not parallel safe, you should use emake -j1, so that other user $MAKEOPTS are respected. You should also include a comment explaining the -j1, so that future maintainers who wish to check whether upstream has fixed their build system can do so. Finally, if no one else has yet reported it, you should report to the upstream maintainers if their build system works with -j1, but fails with -jN for N > 1. |
|
| Back to top |
|
 |
arnelj n00b

Joined: 08 Jan 2004 Posts: 40 Location: Uppsala, Sweden
|
Posted: Wed Nov 07, 2012 6:40 pm Post subject: |
|
|
Hi,
thank you for your answer, the correct ebuild should look like this:
| Code: | # Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-analyzer/openvas-manager/openvas-manager-2.0.4.ebuild,v 1.2 2012/05/04 06:08:10 jdhore Exp $
EAPI="4"
RESTRICT="primaryuri"
inherit cmake-utils
DESCRIPTION="Cli for tellstick house automation transmitter/reciever"
HOMEPAGE="http://www.telldus.se/"
SRC_URI="http://download.telldus.se/TellStick/Software/telldus-core/${P}.tar.gz"
SLOT="0"
LICENSE="LGPL-2"
KEYWORDS="~amd64 ~arm ~x86"
IUSE=""
RDEPEND=""
DEPEND="${RDEPEND}
virtual/pkgconfig
dev-util/cmake"
src_prepare() {
epatch "${FILESDIR}"/telldus-core-2.1.1_fix_missing_include.patch
epatch "${FILESDIR}"/telldus-core-2.1.1_fix_wrong_udev_location.patch
}
src_configure() {
cmake-utils_src_configure
}
src_compile() {
cd "${CMAKE_BUILD_DIR}"
emake -j1 || die "make failed"
}
pkg_postinst() {
elog "Configure your devices by editing the /etc/tellstick.conf file"
elog "Start /usr/sbin/telldusd before use of service"
elog "Caution - the build does only work with -j1"
} |
the patchfiles are the same as in the previous posts |
|
| Back to top |
|
 |
arnelj n00b

Joined: 08 Jan 2004 Posts: 40 Location: Uppsala, Sweden
|
Posted: Sun Nov 11, 2012 4:00 pm Post subject: |
|
|
Hi,
when I installed the Telldus software on my ASUS eee 901 computer I had to change the the user and group to "root" in the /etc/tellstick.conf file. Otherwise I got the message "TellStick not found" when trying to control a switch via the "tdtool -n 1" command.
I also discovered two missed dependencies that has to be added into the telldus-core-2.1.1.ebuild file.
The current ebuild looks like this:
| Code: |
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-analyzer/openvas-manager/openvas-manager-2.0.4.ebuild,v 1.2 2012/05/04 06:08:10 jdhore Exp $
EAPI="4"
RESTRICT="primaryuri"
inherit cmake-utils
DESCRIPTION="Cli for tellstick house automation transmitter/reciever"
HOMEPAGE="http://www.telldus.se/"
SRC_URI="http://download.telldus.se/TellStick/Software/telldus-core/${P}.tar.gz"
SLOT="0"
LICENSE="LGPL-2"
KEYWORDS="~amd64 ~arm ~x86"
IUSE=""
RDEPEND=""
DEPEND="${RDEPEND}
dev-embedded/libftdi
dev-libs/confuse
virtual/pkgconfig
dev-util/cmake"
src_prepare() {
epatch "${FILESDIR}"/telldus-core-2.1.1_fix_missing_include.patch
epatch "${FILESDIR}"/telldus-core-2.1.1_fix_wrong_udev_location.patch
}
src_configure() {
cmake-utils_src_configure
}
src_compile() {
cd "${CMAKE_BUILD_DIR}"
emake -j1 || die "make failed"
}
pkg_postinst() {
elog "Configure your devices by editing the /etc/tellstick.conf file"
elog "Eventually you have to change user and group to root in the tellstick.conf file"
elog "Start /usr/sbin/telldusd before use of service"
elog "Caution - the build does only work with -j1"
} |
I have also made a ebuild for the telldus-gui:
| Code: | # Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-analyzer/openvas-manager/openvas-manager-2.0.4.ebuild,v 1.2 2012/05/04 06:08:10 jdhore Exp $
EAPI="4"
RESTRICT="primaryuri"
inherit cmake-utils
inherit qt4-r2
DESCRIPTION="Gui for tellstick house automation transmitter/reciever"
HOMEPAGE="http://www.telldus.se/"
SRC_URI="http://download.telldus.se/TellStick/Software/telldus-gui/${P}.tar.gz"
SLOT="0"
LICENSE="LGPL-2"
KEYWORDS="~amd64 ~arm ~x86"
IUSE=""
RDEPEND="dev-util/telldus-core"
DEPEND="${RDEPEND}
virtual/pkgconfig
dev-util/cmake"
src_prepare() {
epatch "${FILESDIR}"/telldus-gui-2.1.1_fix_missing_include.patch
}
src_configure() {
qmake "${S}"/3rdparty/qt-components-desktop
cmake-utils_src_configure
}
src_compile() {
cd "${S}"/3rdparty/qt-components-desktop
emake -j1 || die "make failed"
cd "${CMAKE_BUILD_DIR}"
emake -j1 || die "make failed"
}
src_install() {
cd "${CMAKE_BUILD_DIR}"
emake DESTDIR="${D}" install || die "Install failed"
cd "${S}"/3rdparty/qt-components-desktop
qt4-r2_src_install
} |
I don't kwow it the qmake command is the one to use.
The telldus-gui ebuild needs one patch file:
| Code: | --- 3rdparty/qtsingleapplication/src/qtlocalpeer.cpp.orig 2012-11-07 20:19:34.000000000 +0100
+++ 3rdparty/qtsingleapplication/src/qtlocalpeer.cpp 2012-11-07 20:19:09.000000000 +0100
@@ -48,6 +48,7 @@
#include "qtlocalpeer.h"
#include <QtCore/QCoreApplication>
#include <QtCore/QTime>
+#include <unistd.h>
#if defined(Q_OS_WIN)
#include <QtCore/QLibrary> |
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|