I slightly modified the cp210x.c, compiled it, and copied the cp210x.ko to the right place, everything went fine. Now I would like to create a .deb package from it, but I'm stucked. I followed the tutorial, I found here: http://www.webupd8.org/2010/01/how-to-create-deb-package-ubuntu-debian.html
In Step 3. I selected "kernel module" instead of "single binary".
Before Step 3. I only had a Makefile and the cp210x.c in the mydriver-1.0 folder. The Makefile is very simpe:
obj-m += cp210x.o
KVERSION = $(shell uname -r)
all:
make -C /lib/modules/$(KVERSION)/build M=$(PWD) modules
clean:
make -C /lib/modules/$(KVERSION)/build M=$(PWD) clean
After Step 3. I have the following structure:
mydriver-1.0/
├── build-arch-stamp
├── build-indep-stamp
├── configure-stamp
├── cp210x.c
├── debian
│ ├── changelog
│ ├── compat
│ ├── control
│ ├── control.modules.in
│ ├── copyright
│ ├── docs
│ ├── mydriver.cron.d.ex
│ ├── mydriver.default.ex
│ ├── mydriver.doc-base.EX
│ ├── mydriver-modules-_KVERS_.postinst.modules.in.ex
│ ├── mydriver-source
│ │ └── usr
│ │ └── src
│ │ └── modules
│ │ └── mydriver
│ │ └── debian
│ ├── mydriver-source.debhelper.log
│ ├── mydriver-utils
│ ├── mydriver-utils.debhelper.log
│ ├── init.d.ex
│ ├── manpage.1.ex
│ ├── manpage.sgml.ex
│ ├── manpage.xml.ex
│ ├── menu.ex
│ ├── postinst.ex
│ ├── postrm.ex
│ ├── preinst.ex
│ ├── prerm.ex
│ ├── README.Debian
│ ├── README.source
│ ├── rules
│ └── source
│ └── format
└── Makefile
In Step 5 when I try enter
dpkg-buildpackage -rfakeroot
After a while I get this error:
...
# Copy only the driver source to the proper location
cp -s driver/* debian/mydriver-source/usr/src/modules/mydriver
cp: cannot stat driver/*: No such file or directory
debian/rules:130: recipe for target 'install' failed
make: *** [install] Error 1
dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2
Here I'm stuckedI have no clue what is the "driver" folder, should I create it or not and what should I put in it. Google did not help me neither, so I'm grateful for any help.
Related
I downloaded mtd-utils 2.0 and I want to built it for specified deployment path. If I launch:
./configure --bindir .../mtd-utils-81049e5/deploy/usr/sbin
and then I do:
make
I will get output into folder, where I launched make. I want to have executable files somewhere like: bla/mtd-utils-2.0.../deploy/usr/sbin...
IIUC, you can do this like that:
./configure --prefix=/tmp/mtd-utils
make
make install
Finally, you get this:
$ tree /tmp/mtd-utils
/tmp/mtd-utils
├── sbin
│ ├── doc_loadbios
│ ├── docfdisk
│ ├── flash_erase
│ ├── flash_eraseall
│ ├── flash_lock
│ ├── flash_otp_dump
│ ├── flash_otp_info
│ ├── flash_otp_lock
│ ├── flash_otp_write
│ ├── flash_unlock
│ ├── flashcp
│ ├── ftl_check
│ ├── ftl_format
│ ├── jffs2dump
│ ├── jffs2reader
│ ├── mkfs.jffs2
│ ├── mkfs.ubifs
│ ├── mtd_debug
│ ├── mtdinfo
│ ├── mtdpart
│ ├── nanddump
│ ├── nandtest
│ ├── nandwrite
│ ├── nftl_format
│ ├── nftldump
│ ├── recv_image
│ ├── rfddump
│ ├── rfdformat
│ ├── serve_image
│ ├── sumtool
│ ├── ubiattach
│ ├── ubiblock
│ ├── ubicrc32
│ ├── ubidetach
│ ├── ubiformat
│ ├── ubimkvol
│ ├── ubinfo
│ ├── ubinize
│ ├── ubirename
│ ├── ubirmvol
│ ├── ubirsvol
│ └── ubiupdatevol
└── share
└── man
├── man1
│ └── mkfs.jffs2.1
└── man8
└── ubinize.8
5 directories, 44 files
Emmet plugin installed on my vim74.
Here are some tutorial from the mannual .
https://docs.emmet.io/customization/snippets/
Create snippets.json file in extensions folder to add or override snippets.
sudo find / -name 'snippets.jsom'
nothing as output.
No snippets.json in my directories,i want to create it as the mannual say,which directory to put it in?
What does extensions folder mean?
Which directory is extensions folder for my vim and emmet?
tree -L 2 /usr/share/vim
/usr/share/vim
├── addons
│ ├── doc
│ └── plugin
├── registry
│ └── vim-runtime.yaml
├── vim74
│ ├── autoload
│ ├── bugreport.vim
│ ├── bundle
│ ├── colors
│ ├── compiler
│ ├── debian.vim
│ ├── delmenu.vim
│ ├── doc
│ ├── evim.vim
│ ├── filetype.vim
│ ├── ftoff.vim
│ ├── ftplugin
│ ├── ftplugin.vim
│ ├── ftplugof.vim
│ ├── gvimrc_example.vim
│ ├── indent
│ ├── indent.vim
│ ├── indoff.vim
│ ├── keymap
│ ├── lang
│ ├── macros
│ ├── menu.vim
│ ├── mswin.vim
│ ├── optwin.vim
│ ├── plugin
│ ├── print
│ ├── rgb.txt
│ ├── scripts.vim
│ ├── spell
│ ├── synmenu.vim
│ ├── syntax
│ ├── tutor
│ └── vimrc_example.vim
├── vimfiles -> /etc/vim
├── vimrc -> /etc/vim/vimrc
└── vimrc.tiny -> /etc/vim/vimrc.tiny
tree -L 1 /usr/share/vim/vim74/autoload
/usr/share/vim/vim74/autoload
├── adacomplete.vim
├── ada.vim
├── ccomplete.vim
├── clojurecomplete.vim
├── csscomplete.vim
├── decada.vim
├── emmet
├── emmet.vim
├── getscript.vim
├── gnat.vim
├── gzip.vim
├── htmlcomplete.vim
├── javascriptcomplete.vim
├── netrwFileHandlers.vim
├── netrw_gitignore.vim
├── netrwSettings.vim
├── netrw.vim
├── paste.vim
├── phpcomplete.vim
├── python3complete.vim
├── pythoncomplete.vim
├── README.txt
├── rubycomplete.vim
├── spellfile.vim
├── sqlcomplete.vim
├── syntaxcomplete.vim
├── tar.vim
├── tohtml.vim
├── vimball.vim
├── xml
├── xmlcomplete.vim
└── zip.vim
2 directories, 30 files
tree -l 1 /usr/share/vim/vim74/plugin
1 [error opening dir]
/usr/share/vim/vim74/plugin
├── emmet.vim
├── getscriptPlugin.vim
├── gzip.vim
├── matchparen.vim
├── netrwPlugin.vim
├── README.txt
├── rrhelper.vim
├── spellfile.vim
├── tarPlugin.vim
├── tohtml.vim
├── vimballPlugin.vim
└── zipPlugin.vim
The linked page says:
Please refer to README file bundled with your editor’s plugin to find out where Emmet looks for extensions.
When you read this sentence, what is the only reasonable thing to do? Reading your plugin's READMEof course! A README that says:
If you have installed the web-api for emmet-vim you can also add your own snippets using a custom snippets.json file.
Once you have installed the web-api add this line to your .vimrc:
let g:user_emmet_settings = webapi#json#decode(join(readfile(expand('~/.snippets_custom.json')), "\n"))
You can change the path to your snippets_custom.json according to your preferences.
1.to install pathogen.vim
mkdir -p ~/.vim/autoload ~/.vim/bundle && \
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
2.to edite snippets.json
copy https://github.com/emmetio/emmet/blob/master/lib/snippets.json and revise something for your customization.
I want to make html:5 expand as below.
<html lang="zh">
<head>
<meta charset="gbk">
<title></title>
</head>
<body>
</body>
</html>
vim ~./vim/snippets.json
"variables": {
"lang": "zh",
"locale": "en-US",
"charset": "gbk",
"indentation": "\t",
"newline": "\n"
},
To list only part codes of it.
3.to edite your .vimrc to call snippets.json
vim .vimrc
let g:user_emmet_settings = webapi#json#decode(join(readfile(expand('~/.vim/snippets.json')), "\n"))
I'm following Swaroop's Byte of Vim, and have reached the chapter on personal information management, where it says to install the Viki plugin. The instructions are as follows (and I have no real idea of what is going on, but):
Download multvals.vim [2] and store as $vimfiles/plugin/multvals.vim
Download genutils.zip [3] and unzip this file to $vimfiles
Download Viki.zip [4] and unzip this file to $vimfiles (make sure all the folders and files under the 'Viki' folder name are stored directly in the $vimfiles folder)
After this I open a new text file in vim and run the commmand
:set filetype=viki
but I get a whole slew of errors. I've tried clearing out my ~/.vim folder and reinstalling everything, along with tlib this time as specified on the Viki vimscript page, and extracted the version 4.0 viki.vba instead of using the version 4.08 zip file, but I'm still getting errors about non-existent functions:
Error detected while processing home/user/.vim/ftplugin/viki.vim:
line 100
E117: Unknown function: tlib#balloon#Register
I don't really know what's going on, and am quite a new Vim user, so please be patient. Right now my ~/.vim directory tree looks like this:
.vim
├── autoload
│ ├── genutils.vim
│ ├── tlib
│ │ ├── eval.vim
│ │ ├── list.vim
│ │ ├── notify.vim
│ │ ├── persistent.vim
│ │ ├── progressbar.vim
│ │ ├── TestChild.vim
│ │ └── vim.vim
│ ├── tlib.vim
│ ├── viki
│ │ ├── enc_latin1.vim
│ │ └── enc_utf-8.vim
│ ├── viki_anyword.vim
│ ├── viki_latex.vim
│ ├── viki_viki.vim
│ └── viki.vim
├── colors
│ └── molokai.vim
├── compiler
│ └── deplate.vim
├── doc
│ ├── tlib.txt
│ └── viki.txt
├── ftplugin
│ ├── bib
│ │ └── viki.vim
│ └── viki.vim
├── plugin
│ ├── 02tlib.vim
│ ├── genutils.vim
│ ├── multvals.vim
│ └── viki.vim
└── test
└── tlib.vim
Any help is much appreciated.
The info is outdated. You need to install a current versions of tlib and viki from:
https://github.com/tomtom/viki_vim
https://github.com/tomtom/tlib_vim
So I went to this website to download the CUnit framework. I downloaded the folder into my Downloads folder using the following commands. I am getting a lot of errors shown below. Any help would be great. Break it down for me I am a Linux noob.
tar -xvf CUnit-2.1-3.tar.bz2
cd CUnit-2.1-3/
autoreconf --install
./configure
make
sudo make install
cd Examples/
make ExampleTests
Then I get the following errors:
gcc -DRELEASE=#RELEASE# -Wall -W -pedantic -Wshadow -ansi -I/home/renagade629/Downloads/CUnit-2.1-3/CUnit/Headers -std=c99 -L/home/renagade629/Downloads/CUnit-2.1-3/CUnit/Sources ExampleTests.c -o ExampleTests
/usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/crt1.o: In function `_start':
(.text+0x18): undefined reference to `main'
/tmp/ccJcTm0I.o: In function `testSuccess1':
ExampleTests.c:(.text+0x5e): undefined reference to `CU_assertImplementation'
/tmp/ccJcTm0I.o: In function `testSuccess2':
ExampleTests.c:(.text+0x9a): undefined reference to `CU_assertImplementation'
/tmp/ccJcTm0I.o: In function `testSuccess3':
ExampleTests.c:(.text+0xd6): undefined reference to `CU_assertImplementation'
/tmp/ccJcTm0I.o: In function `testSuiteFailure1':
ExampleTests.c:(.text+0x112): undefined reference to `CU_assertImplementation'
/tmp/ccJcTm0I.o: In function `testSuiteFailure2':
ExampleTests.c:(.text+0x14e): undefined reference to `CU_assertImplementation'
/tmp/ccJcTm0I.o:ExampleTests.c:(.text+0x18a): more undefined references to `CU_assertImplementation' follow
/tmp/ccJcTm0I.o: In function `AddTests':
ExampleTests.c:(.text+0x14b9): undefined reference to `CU_get_registry'
ExampleTests.c:(.text+0x14e6): undefined reference to `CU_is_test_running'
ExampleTests.c:(.text+0x151a): undefined reference to `CU_register_suites'
ExampleTests.c:(.text+0x1523): undefined reference to `CU_get_error_msg'
collect2: error: ld returned 1 exit status
make: *** [ExampleTests] Error 1
I also tried to manually compile it using GCC as follows
gcc -Wall -I/Downloads/CUnit-2.1-3/CUnit/Headers ExampleTests.c -o ExampleTests -lcunit
And it gives me this error (not sure why since the .h file exists):
Unit-2.1-3/CUnit/Headers ExampleTests.c -o ExampleTests -lcunit
ExampleTests.c:26:19: fatal error: CUnit.h: No such file or directory
#include "CUnit.h"
^
compilation terminated.
Below is the tree of my CUnit directory
tree
.
├── aclocal.m4
├── AUTHORS
├── autom4te.cache
│ ├── output.0
│ ├── output.1
│ ├── output.2
│ ├── output.3
│ ├── requests
│ ├── traces.0
│ ├── traces.1
│ ├── traces.2
│ └── traces.3
├── bootstrap
├── ChangeLog
├── compile
├── config.guess
├── config.h
├── config.h.in
├── config.h.in~
├── config.log
├── config.status
├── config.sub
├── configure
├── configure.in
├── COPYING
├── CUnit
│ ├── CUnit.dsp
│ ├── Headers
│ │ ├── Automated.h
│ │ ├── Basic.h
│ │ ├── Console.h
│ │ ├── CUCurses.h
│ │ ├── CUError.h
│ │ ├── CUnit.h
│ │ ├── CUnit.h.in
│ │ ├── CUnit_intl.h
│ │ ├── Jamfile
│ │ ├── Makefile
│ │ ├── Makefile.am
│ │ ├── Makefile.in
│ │ ├── MyMem.h
│ │ ├── TestDB.h
│ │ ├── TestRun.h
│ │ ├── Util.h
│ │ └── wxWidget.h
│ ├── Jamfile
│ ├── Makefile
│ ├── Makefile.am
│ ├── Makefile.in
│ └── Sources
│ ├── Automated
│ │ ├── Automated.c
│ │ ├── Automated.lo
│ │ ├── Automated.o
│ │ ├── libcunitautomated.la
│ │ ├── Makefile
│ │ ├── Makefile.am
│ │ └── Makefile.in
│ ├── Basic
│ │ ├── Basic.c
│ │ ├── Basic.lo
│ │ ├── Basic.o
│ │ ├── libcunitbasic.la
│ │ ├── Makefile
│ │ ├── Makefile.am
│ │ └── Makefile.in
│ ├── Console
│ │ ├── Console.c
│ │ ├── Console.lo
│ │ ├── Console.o
│ │ ├── libcunitconsole.la
│ │ ├── Makefile
│ │ ├── Makefile.am
│ │ └── Makefile.in
│ ├── Curses
│ │ ├── Curses.c
│ │ ├── Makefile
│ │ ├── Makefile.am
│ │ └── Makefile.in
│ ├── Framework
│ │ ├── CUError.c
│ │ ├── CUError.lo
│ │ ├── CUError.o
│ │ ├── libcunitfmk.la
│ │ ├── Makefile
│ │ ├── Makefile.am
│ │ ├── Makefile.in
│ │ ├── MyMem.c
│ │ ├── MyMem.lo
│ │ ├── MyMem.o
│ │ ├── TestDB.c
│ │ ├── TestDB.lo
│ │ ├── TestDB.o
│ │ ├── TestRun.c
│ │ ├── TestRun.lo
│ │ ├── TestRun.o
│ │ ├── Util.c
│ │ ├── Util.lo
│ │ └── Util.o
│ ├── libcunit.la
│ ├── Makefile
│ ├── Makefile.am
│ ├── Makefile.in
│ ├── Test
│ │ ├── Jamfile
│ │ ├── Makefile
│ │ ├── Makefile.am
│ │ ├── Makefile.in
│ │ ├── test_cunit.c
│ │ └── test_cunit.h
│ ├── Win
│ │ ├── resource.h
│ │ ├── Win.c
│ │ └── Win.h
│ └── wxWidget
│ ├── icon_suite_active_open.xpm
│ ├── icon_suite_active.xpm
│ ├── icon_suite_inactive_open.xpm
│ ├── icon_suite_inactive.xpm
│ ├── icon_test_active_suite_inactive.xpm
│ ├── icon_test_active.xpm
│ ├── icon_test_inactive_suite_inactive.xpm
│ ├── icon_test_inactive.xpm
│ ├── Makefile.am
│ └── wxWidget.cpp
├── CUnit.dsw
├── cunit.pc
├── cunit.pc.in
├── CUnit.spec
├── CUnit.spec.in
├── depcomp
├── doc
│ ├── CUnit_doc.css
│ ├── error_handling.html
│ ├── fdl.html
│ ├── headers
│ │ ├── Automated.h
│ │ ├── Basic.h
│ │ ├── Console.h
│ │ ├── CUCurses.h
│ │ ├── CUError.h
│ │ ├── CUnit.h
│ │ ├── CUnit_intl.h
│ │ ├── Jamfile
│ │ ├── Makefile
│ │ ├── Makefile.am
│ │ ├── Makefile.in
│ │ ├── MyMem.h
│ │ ├── TestDB.h
│ │ ├── TestRun.h
│ │ ├── Util.h
│ │ ├── Win.h
│ │ └── wxWidget.h
│ ├── index.html
│ ├── introduction.html
│ ├── Jamfile
│ ├── Makefile
│ ├── Makefile.am
│ ├── Makefile.in
│ ├── managing_tests.html
│ ├── running_tests.html
│ ├── test_registry.html
│ └── writing_tests.html
├── Doxyfile
├── Examples
│ ├── AutomatedTest
│ │ ├── AutomatedTest.c
│ │ ├── AutomatedTest.dsp
│ │ ├── AutomatedTest_v1.c
│ │ ├── Jamfile
│ │ ├── Makefile
│ │ ├── Makefile.am
│ │ ├── Makefile.in
│ │ └── README
│ ├── BasicTest
│ │ ├── BasicTest.c
│ │ ├── BasicTest.dsp
│ │ ├── Jamfile
│ │ ├── Makefile
│ │ ├── Makefile.am
│ │ ├── Makefile.in
│ │ └── README
│ ├── ConsoleTest
│ │ ├── ConsoleTest.c
│ │ ├── ConsoleTest.dsp
│ │ ├── ConsoleTest_v1.c
│ │ ├── Jamfile
│ │ ├── Makefile
│ │ ├── Makefile.am
│ │ ├── Makefile.in
│ │ └── README
│ ├── CursesTest
│ │ ├── CursesTest.c
│ │ ├── CursesTest_v1.c
│ │ ├── Jamfile
│ │ ├── Makefile
│ │ ├── Makefile.am
│ │ ├── Makefile.in
│ │ └── README
│ ├── Demo_fprintf
│ │ └── CUnitExample.c
│ ├── ExampleTests.c
│ ├── ExampleTests.h
│ ├── Jamfile
│ ├── Makefile
│ ├── Makefile.am
│ ├── Makefile.in
│ ├── WinTest
│ │ ├── Jamfile
│ │ ├── ReadMe.txt
│ │ ├── StdAfx.cpp
│ │ ├── StdAfx.h
│ │ ├── WinTest.cpp
│ │ ├── WinTest.dsp
│ │ └── WinTest_v1.cpp
│ └── wxWidgetsTest
│ ├── Makefile.am
│ ├── README
│ ├── wxWidgetsTest.c
│ └── wxWidgetsTest.rc
├── INSTALL
├── install-sh
├── Jambase
├── Jamfile
├── Jamrules
├── Jamrules.in
├── libcunit_dll.def
├── libtool
├── ltmain.sh
├── Makefile
├── Makefile.am
├── Makefile.in
├── Man
│ ├── Jamfile
│ ├── Makefile
│ ├── Makefile.am
│ ├── Makefile.in
│ └── man3
│ ├── CUnit.3
│ ├── Jamfile
│ ├── Makefile
│ ├── Makefile.am
│ └── Makefile.in
├── missing
├── mkinstalldirs
├── NEWS
├── PACKAGE
├── README
├── Share
│ ├── CUnit-List.dtd
│ ├── CUnit-List.xsl
│ ├── CUnit-Run.dtd
│ ├── CUnit-Run.xsl
│ ├── Jamfile
│ ├── Makefile
│ ├── Makefile.am
│ ├── Makefile.in
│ ├── md2xml.pl
│ ├── Memory-Dump.dtd
│ └── Memory-Dump.xsl
├── stamp-h1
├── stamp-h.in
├── TODO
├── VC7
│ ├── AutomatedTest
│ │ └── AutomatedTest.vcproj
│ ├── AutomatedTest_v1
│ │ └── AutomatedTest_v1.vcproj
│ ├── BasicTest
│ │ └── BasicTest.vcproj
│ ├── ConsoleTest
│ │ └── ConsoleTest.vcproj
│ ├── ConsoleTest_v1
│ │ └── ConsoleTest_v1.vcproj
│ ├── CUnit.sln
│ ├── CUnit.suo
│ ├── libcunit
│ │ └── libcunit.vcproj
│ ├── Readme.txt
│ └── test_cunit
│ └── test_cunit.vcproj
├── VC8
│ ├── AutomatedTest_v1.vcproj
│ ├── AutomatedTest.vcproj
│ ├── BasicTest.vcproj
│ ├── ConsoleTest_v1.vcproj
│ ├── ConsoleTest.vcproj
│ ├── CUnit.sln
│ ├── CUnit.suo
│ ├── libcunit.vcproj
│ ├── Readme.txt
│ ├── test_cunit.vcproj
│ └── wxWidgetsTest.vcproj
├── VC9
│ ├── AutomatedTest.vcproj
│ ├── BasicTest.vcproj
│ ├── ConsoleTest.vcproj
│ ├── CUnit.sln
│ ├── CUnit.sln.cache
│ ├── CUnit.suo
│ ├── libcunit.vcproj
│ ├── Readme.txt
│ └── test_cunit.vcproj
└── VERSION
The manual command is failing because you didn't use the correct -I flag. You lost the leading /home/renagade629 prefix when you transcribed the make output.
I have created a directory structure with an executable file. Following is the output of tree:
program-5
├── debian
│ ├── DEBIAN
│ │ ├── changelog
│ │ ├── compat
│ │ ├── control
│ │ ├── copyright
│ │ ├── docs
│ │ ├── emacsen-install.ex
│ │ ├── emacsen-remove.ex
│ │ ├── emacsen-startup.ex
│ │ ├── init.d.ex
│ │ ├── manpage.1.ex
│ │ ├── manpage.sgml.ex
│ │ ├── manpage.xml.ex
│ │ ├── menu.ex
│ │ ├── postinst.ex
│ │ ├── postrm.ex
│ │ ├── preinst.ex
│ │ ├── prerm.ex
│ │ ├── program.cron.d.ex
│ │ ├── program.debhelper.log
│ │ ├── program.default.ex
│ │ ├── program.doc-base.EX
│ │ ├── README.Debian
│ │ ├── README.source
│ │ ├── rules
│ │ └── watch.ex
│ └── usr
│ └── local
│ └── include
│ └── myprog
│ ├── file.txt
└── program *(executable)*
This however, is not working with "file.txt". I want this file to go into /usr/local/include/myprog/ but that is not happening. it's giving me the error:
(Reading database ...
(Reading database ... 5%
...
(Reading database ... 100%
(Reading database ... 204105 files and directories currently installed.)
Unpacking program-v5 (from .../program-5_1.4.2_i386.deb) ...
dpkg: error processing /tmp/program-5/debian/program-5_1.4.2_i386.deb (--install):
trying to overwrite '/usr/local/include/myprog/file.txt', which is also in package program2 20120329-1
dpkg-deb (subprocess): data: internal gzip write error: Broken pipe
dpkg-deb: error: subprocess <decompress> returned error exit status 2
dpkg-deb (subprocess): failed in write on buffer copy for failed to write to pipe in copy: Broken pipe
Errors were encountered while processing:
/tmp/program-5/debian/program-5_1.4.2_i386.deb
Can anyone offer any advice?
The error is pretty clear: You try to install program-v5 and it attempts to overwrite a file already present and owned by package program2.
So you need to either
manually uninstall program2 before installing program-v5, or
add the required Conflicts:, Provides:, Replaces: flags in debian/control -- see the docs.
Lastly, for packages, /usr is a more natural choice then /usr/local.
From the error message:
trying to overwrite '/usr/local/include/myprog/file.txt', which is
also in package program2
It looks like you have a package program2 already installed on your system that have already installed this file usr/local/include/myprog/file.txt.
You should first uninstall this package dpkg -r program2