--- /dev/null
+diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
+index 5e8fa25..8304a0c 100644
+--- a/doc/CMakeLists.txt
++++ b/doc/CMakeLists.txt
+@@ -14,11 +14,10 @@ add_custom_target(progdoc COMMENT "create program documentation files")
+ if(HELP2MAN AND GZIP)
+ message(STATUS "can create man page")
+
+- set(DOC_MAN ${CMAKE_CURRENT_BINARY_DIR}/simulavr.1.gz)
++ set(DOC_MAN ${CMAKE_CURRENT_BINARY_DIR}/simulavr.1)
+
+ add_custom_command(OUTPUT ${DOC_MAN}
+- COMMAND ${HELP2MAN} -o ${CMAKE_CURRENT_BINARY_DIR}/simulavr.1 "$<TARGET_FILE:simulavr>"
+- COMMAND ${GZIP} -n9 ${CMAKE_CURRENT_BINARY_DIR}/simulavr.1)
++ COMMAND ${HELP2MAN} -o ${CMAKE_CURRENT_BINARY_DIR}/simulavr.1 "$<TARGET_FILE:simulavr>")
+ add_custom_target(doc-man DEPENDS ${DOC_MAN})
+ add_dependencies(progdoc doc-man)
+
+@@ -36,11 +35,10 @@ endif()
+ if(MAKEINFO AND GZIP)
+ message(STATUS "can create info page")
+
+- set(DOC_INFO ${CMAKE_CURRENT_BINARY_DIR}/simulavr.info.gz)
++ set(DOC_INFO ${CMAKE_CURRENT_BINARY_DIR}/simulavr.info)
+
+ add_custom_command(OUTPUT ${DOC_INFO}
+- COMMAND ${MAKEINFO} ${CMAKE_CURRENT_BINARY_DIR}/simulavr.texi
+- COMMAND ${GZIP} -n9 ${CMAKE_CURRENT_BINARY_DIR}/simulavr.info)
++ COMMAND ${MAKEINFO} ${CMAKE_CURRENT_BINARY_DIR}/simulavr.texi)
+ add_custom_target(doc-info DEPENDS ${DOC_INFO})
+ add_dependencies(progdoc doc-info)
+
+@@ -56,14 +54,12 @@ else()
+ endif()
+
+ if(GZIP)
+- set(DOC_CHANGELOG ${CMAKE_CURRENT_BINARY_DIR}/changelog.gz)
++ set(DOC_CHANGELOG ${CMAKE_CURRENT_BINARY_DIR}/changelog)
+
+- add_custom_command(OUTPUT ${DOC_CHANGELOG}
+- COMMAND ${GZIP} -n9 ${CMAKE_CURRENT_BINARY_DIR}/changelog)
+ add_custom_target(doc-changelog DEPENDS ${DOC_CHANGELOG})
+ add_dependencies(progdoc doc-changelog)
+
+- install(FILES ${DOC_CHANGELOG} DESTINATION "share/doc/common")
++ install(FILES ${DOC_CHANGELOG} DESTINATION "share/doc/simulavr-${PACKAGE_VERSION}")
+ endif()
+
+ add_custom_target(doc COMMENT "create simulavr documentation" DEPENDS progdoc)
+diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt
+index 8c2f7c0..c23b06f 100644
+--- a/app/CMakeLists.txt
++++ b/app/CMakeLists.txt
+@@ -21,6 +21,6 @@ set(docSrcs ${docDir}/AUTHORS
+ ${docDir}/README.gdb
+ ${docDir}/SUPPORT
+ ${docDir}/TODO)
+-install(FILES ${docSrcs} DESTINATION "share/doc/common")
++install(FILES ${docSrcs} DESTINATION "share/doc/simulavr-${PACKAGE_VERSION}")
+
+ EOF
+diff --git a/libsim/CMakeLists.txt b/libsim/CMakeLists.txt
+index c50f050..6175124 100644
+--- a/libsim/CMakeLists.txt
++++ b/libsim/CMakeLists.txt
+@@ -41,13 +41,13 @@ file(GLOB files_ui "${CMAKE_SOURCE_DIR}/include/ui/*.h")
+ file(GLOB files_cmd "${CMAKE_SOURCE_DIR}/include/cmd/*.h")
+ file(GLOB files_elfio "${CMAKE_SOURCE_DIR}/include/elfio/elfio/*.hpp")
+
+-install(TARGETS sim DESTINATION "lib")
+-install(FILES ${files_common} DESTINATION "include")
+-install(FILES ${files_hwtimer} DESTINATION "include/hwtimer")
+-install(FILES ${files_gdb} DESTINATION "include/gdb")
+-install(FILES ${files_ui} DESTINATION "include/ui")
+-install(FILES ${files_cmd} DESTINATION "include/cmd")
+-install(FILES ${files_elfio} DESTINATION "include/elfio/elfio")
++install(TARGETS sim LIBRARY)
++install(FILES ${files_common} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/")
++install(FILES ${files_hwtimer} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/hwtimer")
++install(FILES ${files_gdb} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/gdb")
++install(FILES ${files_ui} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/ui")
++install(FILES ${files_cmd} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/cmd")
++install(FILES ${files_elfio} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/elfio/elfio")
+
+ if(BUILD_VERILOG)
+
--- /dev/null
+# Copyright 2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+inherit cmake-utils git-r3
+
+EGIT_REPO_URI="https://git.savannah.gnu.org/git/simulavr.git"
+EGIT_COMMIT="release-${PV}"
+
+DESCRIPTION="A simulator for the Atmel AVR family of microcontrollers"
+HOMEPAGE="https://www.nongnu.org/simulavr/"
+MYPNV="${PN}-${EGIT_COMMIT}"
+SRC_URI="https://git.savannah.nongnu.org/cgit/${PN}.git/snapshot/${MYPNV}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~x86 ~amd64"
+
+IUSE="verilog"
+RDEPEND=""
+DEPEND="sys-apps/sed
+ cross-avr/gcc
+ >=dev-lang/swig-2.0.0
+ sys-apps/texinfo
+ >=dev-lang/python-3.5
+ sys-libs/ncurses
+ verilog? ( dev-tcltk/itcl sci-electronics/iverilog )"
+RDEPEND="${DEPEND}"
+BDEPEND=""
+
+PATCHES="${FILESDIR}/fix-git-version.patch
+ ${FILESDIR}/fix-installpath.patch"
+
+src_configure() {
+ local mycmakeargs=(
+ -DCMAKE_INSTALL_INCLUDEDIR=include/${PN}-${PV}
+ -DPACKAGE_VERSION=${PV}
+ -DBUILD_VERILOG=$(usex verilog)
+ )
+
+ cmake-utils_src_configure ${mycmakeargs}
+}
+
+src_compile() {
+ cmake-utils_src_compile
+ cmake-utils_src_make doc
+}