mirror of
https://github.com/arcan1s/netctl-gui.git
synced 2025-04-24 15:37:23 +00:00
created file tree
This commit is contained in:
parent
f68918e599
commit
037faa8a56
4
.gitignore
vendored
4
.gitignore
vendored
@ -11,3 +11,7 @@
|
|||||||
*.lai
|
*.lai
|
||||||
*.la
|
*.la
|
||||||
*.a
|
*.a
|
||||||
|
|
||||||
|
# Source archive
|
||||||
|
*.tar.xz
|
||||||
|
|
||||||
|
33
PKGBUILD
Normal file
33
PKGBUILD
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
# Author: Evgeniy "arcanis" Alexeev <esalexeev@gmail.com>
|
||||||
|
# Maintainer: Evgeniy "arcanis" Alexeev <esalexeev@gmail.com>
|
||||||
|
|
||||||
|
pkgname=kdeplasma-applets-netctl-monitor
|
||||||
|
_pkgname=netctl-monitor
|
||||||
|
pkgver=1.0.0
|
||||||
|
pkgrel=1
|
||||||
|
pkgdesc="Plasmoid written on C++ which interacts with netctl"
|
||||||
|
arch=('i686' 'x86_64')
|
||||||
|
url="http://arcan1s.github.io/projects/netctlmonitor"
|
||||||
|
license=('GPLv3')
|
||||||
|
depends=('kdebase-workspace')
|
||||||
|
makedepends=('cmake' 'automoc4')
|
||||||
|
source=(https://github.com/arcan1s/netctlmonitor/releases/download/V.${pkgver}/${_pkgname}-${pkgver}-src.tar.xz)
|
||||||
|
install=${pkgname}.install
|
||||||
|
md5sums=('d3ab03ddea1e4793cfc5f35a0f7a5ff1')
|
||||||
|
|
||||||
|
build () {
|
||||||
|
if [[ -d ${srcdir}/build ]]; then
|
||||||
|
rm -rf "${srcdir}/build"
|
||||||
|
fi
|
||||||
|
mkdir "${srcdir}/build"
|
||||||
|
cd "${srcdir}/build"
|
||||||
|
cmake -DCMAKE_BUILD_TYPE=Release \
|
||||||
|
-DCMAKE_INSTALL_PREFIX=`kde4-config --prefix` \
|
||||||
|
../${_pkgname}
|
||||||
|
make
|
||||||
|
}
|
||||||
|
|
||||||
|
package() {
|
||||||
|
cd "${srcdir}/build"
|
||||||
|
make DESTDIR="${pkgdir}" install
|
||||||
|
}
|
23
create_archive.sh
Executable file
23
create_archive.sh
Executable file
@ -0,0 +1,23 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
ARCHIVE="netctl-monitor"
|
||||||
|
SRCDIR="sources"
|
||||||
|
FILES="LICENSE README.md"
|
||||||
|
IGNORELIST="CMakeLists.txt.user"
|
||||||
|
VERSION=$(grep -m1 PROJECT_VERSION_MAJOR sources/CMakeLists.txt | awk '{print $3}' | cut -c 1).\
|
||||||
|
$(grep -m1 PROJECT_VERSION_MINOR sources/CMakeLists.txt | awk '{print $3}' | cut -c 1).\
|
||||||
|
$(grep -m1 PROJECT_VERSION_PATCH sources/CMakeLists.txt | awk '{print $3}' | cut -c 1)
|
||||||
|
|
||||||
|
# create archive
|
||||||
|
[[ -e ${ARCHIVE}-${VERSION}.tar.xz ]] && rm -f "${ARCHIVE}-${VERSION}-src.tar.xz"
|
||||||
|
[[ -d ${ARCHIVE} ]] && rm -rf "${ARCHIVE}"
|
||||||
|
cp -r "${SRCDIR}" "${ARCHIVE}"
|
||||||
|
for FILE in ${FILES[*]}; do cp "$FILE" "${ARCHIVE}"; done
|
||||||
|
for FILE in ${IGNORELIST[*]}; do rm -f "${ARCHIVE}/${FILE}"; done
|
||||||
|
tar cvJf "${ARCHIVE}-${VERSION}-src.tar.xz" "${ARCHIVE}" > /dev/null
|
||||||
|
rm -rf "${ARCHIVE}"
|
||||||
|
|
||||||
|
# update md5sum
|
||||||
|
MD5SUMS=$(md5sum ${ARCHIVE}-${VERSION}-src.tar.xz | awk '{print $1}')
|
||||||
|
sed -i "/md5sums=('[0-9A-Fa-f]*/s/[^'][^)]*/md5sums=('${MD5SUMS}'/" PKGBUILD
|
||||||
|
sed -i "s/pkgver=[0-9.]*/pkgver=${VERSION}/" PKGBUILD
|
43
sources/CMakeLists.txt
Normal file
43
sources/CMakeLists.txt
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
cmake_minimum_required (VERSION 2.8)
|
||||||
|
|
||||||
|
cmake_policy (SET CMP0003 OLD)
|
||||||
|
cmake_policy (SET CMP0002 OLD)
|
||||||
|
cmake_policy (SET CMP0011 NEW)
|
||||||
|
cmake_policy (SET CMP0015 NEW)
|
||||||
|
|
||||||
|
project (netctl-monitor)
|
||||||
|
set (PROJECT_VERSION_MAJOR 1)
|
||||||
|
set (PROJECT_VERSION_MINOR 0)
|
||||||
|
set (PROJECT_VERSION_PATCH 0)
|
||||||
|
set (PROJECT_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH})
|
||||||
|
configure_file (${CMAKE_SOURCE_DIR}/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/version.h)
|
||||||
|
|
||||||
|
message (STATUS "Version ${PROJECT_VERSION}")
|
||||||
|
|
||||||
|
set (COMPS netctl-gui
|
||||||
|
netctl-monitor)
|
||||||
|
|
||||||
|
# install options
|
||||||
|
option (WITH_DEBUG_MODE "Build with debug mode" OFF)
|
||||||
|
option (BUILD_GUI "Build GUI" ON)
|
||||||
|
option (BUILD_PLASMOID "Build plasmoid" ON)
|
||||||
|
|
||||||
|
# verbose
|
||||||
|
set (CMAKE_VERBOSE_MAKEFILE ON)
|
||||||
|
|
||||||
|
# flags
|
||||||
|
if ( WITH_DEBUG_MODE )
|
||||||
|
add_definitions ( -DDEBUG_MODE=1 )
|
||||||
|
endif ()
|
||||||
|
if ( CMAKE_COMPILER_IS_GNUCXX )
|
||||||
|
set (ADD_CXX_FLAGS "-Wall")
|
||||||
|
set (CMAKE_CXX_FLAGS "-O0 ${ADD_CXX_FLAGS}")
|
||||||
|
set (CMAKE_CXX_FLAGS_DEBUG "-g -O0")
|
||||||
|
set (CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
|
||||||
|
else ()
|
||||||
|
message ("Unknown compiler")
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
foreach (COMP ${COMPS})
|
||||||
|
add_subdirectory (${COMP})
|
||||||
|
endforeach ()
|
13
sources/netctl-gui/CMakeLists.txt
Normal file
13
sources/netctl-gui/CMakeLists.txt
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
# set project name
|
||||||
|
set (SUBPROJECT netctl-gui)
|
||||||
|
# set directories
|
||||||
|
set (SUBPROJECT_BINARY_DIR bin)
|
||||||
|
set (SUBPROJECT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src)
|
||||||
|
# executable path
|
||||||
|
set (EXECUTABLE_OUTPUT_PATH ${SUBPROJECT_BINARY_DIR})
|
||||||
|
|
||||||
|
# additional targets
|
||||||
|
set (TARGETS "")
|
||||||
|
set (HEADERS "")
|
||||||
|
|
||||||
|
add_subdirectory (${SUBPROJECT_SOURCE_DIR})
|
31
sources/netctl-gui/src/CMakeLists.txt
Normal file
31
sources/netctl-gui/src/CMakeLists.txt
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
# set files
|
||||||
|
file (GLOB SOURCES *.cpp)
|
||||||
|
file (GLOB HEADERS *.h)
|
||||||
|
file (GLOB FORMS *.ui)
|
||||||
|
|
||||||
|
message (STATUS "${SUBPROJECT} SOURCES: ${SOURCES}")
|
||||||
|
message (STATUS "${SUBPROJECT} HEADERS: ${HEADERS}")
|
||||||
|
message (STATUS "${SUBPROJECT} FORMS: ${FORMS}")
|
||||||
|
|
||||||
|
# include_path
|
||||||
|
include_directories (${SUBPROJECT_SOURCE_DIR}
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/../)
|
||||||
|
|
||||||
|
find_package (Qt4 REQUIRED)
|
||||||
|
include (${QT_USE_FILE})
|
||||||
|
qt4_wrap_cpp (MOC_SOURCES ${HEADERS})
|
||||||
|
qt4_wrap_ui (UI_HEADERS ${FORMS})
|
||||||
|
|
||||||
|
source_group ("Header Files" FILES ${HEADERS})
|
||||||
|
source_group ("Source Files" FILES ${SOURCES})
|
||||||
|
source_group ("Generated Files" FILES ${MOC_SOURCES})
|
||||||
|
|
||||||
|
add_executable (${SUBPROJECT} ${UI_HEADERS} ${HEADERS} ${SOURCES} ${MOC_SOURCES})
|
||||||
|
target_link_libraries (${SUBPROJECT} ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY})
|
||||||
|
|
||||||
|
# install properties
|
||||||
|
install (TARGETS ${SUBPROJECT} DESTINATION bin)
|
||||||
|
install (FILES ../${SUBPROJECT}.desktop DESTINATION share/applications/)
|
||||||
|
install (FILES ../${SUBPROJECT}-logo.png DESTINATION share/pixmaps/)
|
||||||
|
install (FILES ../${SUBPROJECT}.png DESTINATION share/icons/hicolor/32x32/apps/)
|
32
sources/netctl-monitor/CMakeLists.txt
Normal file
32
sources/netctl-monitor/CMakeLists.txt
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
# set project name
|
||||||
|
set (SUBPROJECT plasma_applet_netctl-monitor)
|
||||||
|
|
||||||
|
# find required libaries
|
||||||
|
find_package (KDE4 REQUIRED)
|
||||||
|
include (KDE4Defaults)
|
||||||
|
|
||||||
|
add_definitions (${QT_DEFINITIONS}
|
||||||
|
${KDE4_DEFINITIONS})
|
||||||
|
include_directories (${CMAKE_SOURCE_DIR}
|
||||||
|
${CMAKE_BINARY_DIR}
|
||||||
|
${KDE4_INCLUDES}
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/../)
|
||||||
|
|
||||||
|
# set sources
|
||||||
|
set (PLUGIN_NAME ${SUBPROJECT})
|
||||||
|
file (GLOB SUBPROJECT_DESKTOP *.desktop)
|
||||||
|
file (GLOB SUBPROJECT_ICON *.png)
|
||||||
|
file (GLOB SUBPROJECT_NOTIFY *.notifyrc)
|
||||||
|
file (GLOB SUBPROJECT_SOURCE *.cpp)
|
||||||
|
file (GLOB SUBPROJECT_UI *.ui)
|
||||||
|
|
||||||
|
# make
|
||||||
|
kde4_add_ui_files (SUBPROJECT_SOURCE ${SUBPROJECT_UI})
|
||||||
|
kde4_add_plugin (${PLUGIN_NAME} ${SUBPROJECT_SOURCE})
|
||||||
|
target_link_libraries (${PLUGIN_NAME} ${KDE4_PLASMA_LIBS} ${KDE4_KDEUI_LIBS})
|
||||||
|
|
||||||
|
# install
|
||||||
|
install (TARGETS ${PLUGIN_NAME} DESTINATION ${PLUGIN_INSTALL_DIR})
|
||||||
|
install (FILES ${SUBPROJECT_DESKTOP} DESTINATION ${SERVICES_INSTALL_DIR})
|
||||||
|
install (FILES ${SUBPROJECT_ICON} DESTINATION ${ICON_INSTALL_DIR})
|
||||||
|
install (FILES ${SUBPROJECT_NOTIFY} DESTINATION ${DATA_INSTALL_DIR}/${PLUGIN_NAME})
|
8
sources/version.h.in
Normal file
8
sources/version.h.in
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
#ifndef VERSION_H
|
||||||
|
#define VERSION_H
|
||||||
|
|
||||||
|
#ifndef PROJ_VERSION
|
||||||
|
#define PROJ_VERSION "@PROJECT_VERSION@"
|
||||||
|
#endif /* PROJ_VERSION */
|
||||||
|
|
||||||
|
#endif /* VERSION_H */
|
Loading…
Reference in New Issue
Block a user